JSPWiki also supports raw HTML embedded in the WikiMarkup. You can enable it in the jspwiki.properties-file, by setting

jspwiki.translatorReader.allowHTML = true

By default, this option is set to false, since it can be a very dangerous option to enable. See below for discussion on the benefits and disadvantages.

SECURITY WARNING:
Please note that installation and/or use of this feature on a public wiki is a security risk. This feature should only be used on a private or intranet wiki where the environment is entirely trusted.

Please RefactorMe.


Allowing Raw HTML#

Referring to WikiMarkupDevelopment :
   "remember that we don't really want to reinvent HTML in a more cumbersome form."
,why not simply allow html tags usage, and let them go unprocessed, like TWiki does?
I see huge advantages here:
  • for JSPWiki users : more functionalities, less limitations
  • for JSPWiki developers : not having to reinvent all the html tags.

If, for some reason, they cannot be allowed everywhere, they could be restricted to html friendly areas, with a special tag:

    <<<  <table border=1000>
<td style ="{position: fixed; width:100}">sdf</td><td>sdfsdfsdf</td> >>> Begin/end html enabled block. 

I feel this small change would have the highest ROI you could think of for JSPWiki.

--Alain Ravet

There are a bunch of reasons, mostly explained best at WikiWikiWeb:WhyDoesntWikiDoHtml. To quote:

It's the difference between having a Wiki that miscreants can harm, and having a Wiki that miscreants can use to harm you.

I'm not really that against it. It's just not a priority. If anyone wants to write an addition (that is capable of filtering out Javascript, please)... hey, grreat! I'll add it.

(In fact, I think that you don't really need any special tags to allow HTML. You could probably just turn off the translation of < and >. This would of course invalidate the characters themselves... Also, you should make it sure that all tags are closed up properly, or else you might end up in a very messy layout, making it even impossible to edit your mistake.)

And no, we're not going to reinvent all HTML tags. Table support was probably the biggest thing missing, and then perhaps the ability to highlight things. I don't see much else that we'd be interested in. The ideal HTML plugin would be one that would

  • check all its input and make sure you can't really screw up the page.
  • allow only a specific set of HTML to be used.

Unfortunately, the first requires the need to assume too much about the layout on the model side, breaking the Model-View-Controller paradigm. This is the case with the "HTML friendly areas" you speak above.

It's kinda tricky to do right.

--JanneJalkanen

I agree, Janne, and i would go even further. The simplicity of Wiki syntax is a great part of it's appeal to me. My argument against allowing HTML into your files is that that makes the files uneditable to those who don't know HTML. Lowering the barriers to entry to content editing is a huge part of the value of Wiki's, in my opinion. I want my mom to be able to create a page. I want my co-worker to be able to add new items to a page for the first time without having to worry that they're "doing it wrong". And without being able to do it wrong (you can definitely make mistakes in HTML), in some sort of way they can't easily figure out. Heck, the new table stuff confused me (it seems to require a space after the pipe, which i wasn't expecting), and I've written lots of HTML tables by hand.

Besides, having only a few choices about what to do to text means that I pointlessly fiddle with text a lot less. Which is good. I should be thinking about the words, not the point size of the font I'm showing them in. Incidently, this also means that all of the pages in a Wiki have a visual unity that could easily be lost with allowing raw HTML. -- MahlenMorris

Oh yeah, the table functionality was completely rewritten in 1.6.11. You'll find that it no longer cares about correct placing of spaces and is quite lax about the format it supports. --JanneJalkanen

One of the reasons for my suggesting JSWiki to accept Raw Html (see above), is that, amongsr other reasons, it would allow me to create better looking image tables Ex : This is a tooltip

TooltipI'm a tooltip tooTooltip 3
storystorystory

I'd like to (as on YahooNews site)

  1. associate the image to link below (href) and remove the useless "story" cells.
  2. associate a tooltip to the image.

--AlainRavet

JanneJalkanen:Well, currently the link text [this one here|http://foobar] is set as the "ALT" text of the image. Perhaps we should just state that when the link text is also an URL, then it creates a link instead of an ALT text?

BTW, at least IE shows the ALT text as a tooltip. Try it with the above images.

Update on 30-May-02: Note that the link text is now considered also a hyperlink, so you can make image links.

MahlenMorris: I'm not convinced that those story links are useless. I wouldn't have known there was a story connected to each picture otherwise. Now it's true, if I were to run the mouse over the pics I might notice the cursor change and the URL appear somwhere on my screen, but that's awfully subtle for some people, and why require a person to make an action just to see if there's more info.

Admittedly, that's not a reason to disallow raw HTML. But if it were in place, I'd want a switch to shut it off.

NiiloNeuvo: Since plugins allow you to write raw HTML why don't you use them? What I did was:

[{INSERT net.basen.Image path='basen/anipa/sample.png'}]
This allowed me to add all sorts of html-things (and even javascript) around the image. The end users can't screw this and this is fairly nice to use.

JanneJalkanen: True, but you'll need to make a separate plugin for many things. And they're not very good in very many places - not too userfriendly.

NiiloNeuvo: In my world that is quite user friendly. Imagine having a thousand images in a photo gallery. This is much better than having to write <table>. Plugins are fairly easy to do, we should have a way of dynamically creating them from the web pages ;-)


Raw HTML is now allowed from JSPWiki 2.0.11 onwards. Please view the discussion above as to what might happen if you enable it in your own Wiki. :-)

You can enable it in the jspwiki.properties-file, by setting

jspwiki.translatorReader.allowHTML = true


Great. Now, we can do things like :

Example :#

AllowingRawHTML/htmlSample.png

The outer page (the matrix) uses

  • raw html
  • Include

Code

<table border=1000>
<td style ="{position: fixed; width:100}">sdf</td><td>sdfsdfsdf</td> 
</table>
<table width="100%" border=1 valign='top'>

<tr align=right> 
   <td width='50%'><font size='-2'>[TodoNow]</font></td>
   <td width='50%'><font size='-2'>[TodoLater]</font></td>
</tr>
<tr border=1> 
   <td width='50%'>[{IncludePage page='TodoNow' showPageName='false'}]</td>
   <td width='50%'><font size='-1'>[{IncludePage page='TodoLater' showPageName='false'}]</font></td>
</tr>

<tr align=right> 
   <td width='50%'><font size='-2'>[TodoLaterLater]</font></td>
   <td width='50%'><font size='-2'>[TodoDone]</font></td>
</tr>

<tr border=1> 
   <td width='50%'><font size='-1'>[{IncludePage page='TodoLaterLater' showPageName='false'}]</font></td>
   <td width='50%'><font size='-1'>[{IncludePage page='TodoDone' showPageName='false'}]</font></td>
</tr>
</table>
<table border=1000>
<td style ="{position: fixed; width:100}">sdf</td><td>sdfsdfsdf</td> 

The inner pages use

  • raw html
  • attached image
<table border=1000> <td style ="{position: fixed; width:100}">sdf</td><td>sdfsdfsdf</td>
<font color=blue>
[Pic/cb_on.png] clean wiki site
</font>\\
[Pic/cb_off.png] install blojsom\\
[Pic/cb_off.png] (re)install mysql\\

--AlainRavet

Sorry, but a better layout for tables does not require HTML support - you wouldn't want any Wikipage author to have to build tables like that, don't you? Raw HTML does not belong in a Wiki. Perhaps we can think of a way to add somewhat better layout features to tables in the way that TiddlyWiki does? --Wouter


Now with raw HTML enabled, I have not found an easy way to add text with angle brackets, e.g.: <someremark>. The browser will interpret this as HTML tag and simply display nothing. The only way that seems to be working is to include all that text inside triple curly brackets like this: {{{<someremark>}}}. That makes it impossible however to format the text any further, e.g. make <someremark> bold. One work-around I tried was to use &lt;someremark&gt;. That displays fine in the preview but the final page converts these entities back to the original characters and I am stuck with the original problem.

--FabianRitzmann, 03-Oct-2007


May be it would be useful to enable raw HTML only for some user groups restricted pages. Is there any possibility to link the permission for HTML with the permission to view/edit page by a group?

--Claudio, 30-Oct-2007


Help....I am new to JSPWIKI but familiar with TWIKI. I am trying to recreate the IFRAME plugin from TWIKI to allow us to insert an HTML into the WIKI Page without using a file link that opens another window. Anyone ever done this or have any suggestions?

--AnonymousCoward, 23-Jan-2008

Add new attachment

Only authorized users are allowed to upload new attachments.

List of attachments

Kind Attachment Name Size Version Date Modified Author Change note
png
htmlSample.PNG 16.3 kB 1 08-Feb-2003 10:43 AlainRavet
png
htmlSample.png 16.3 kB 1 08-Feb-2003 10:47 AlainRavet
« This page (revision-34) was last changed on 23-Jan-2008 23:55 by AnonymousCoward