Loading...
 
Skip to main content

Author Coffeeshop


maintaining escaped HTML

posts: 2

I've been evaluating wikis for my company, and i'm stuck between mediawiki and tikiwiki. I far preferred TW until i ran into this problem: when i escape HTML and save the wiki page, the page renders correctly. However, when i next edit that page, the code served up in the edit textarea has replaced the escaped HTML entities with their actual entities... this means that on saving the edit, i've lost my escaped HTML with the result that my browser tries to render these tags.

for example, if i use the following code to create a code example and then save it:

Copy to clipboard
<dst:criteria> <dst:content> </dst:content> </dst:criteria>


the XML tags are displayed on the wiki page.

When i edit the page, this code chunk has replaced the escaped entities with the actual entities. when i save that page, i get a box containing only .

I can use the construct <dst:criteria> to escape these tags successfully, except inside the
Copy to clipboard
tag used to display the code example.


For my needs, this is a deal-killer. Now, even a limited wiki like xwiki has single character escaping using a backslash, so to display an xml tag i can just write \<dst:content\>.

Thanks, and I did search through the documentation and forum for this stuff but to no avail,
--derek

posts: 36 Japan

I checked in Tiki 1.9.8.3 and 1.10CVS (HTML not enabled in the wiki at either site). For inline escaping, the Tiki syntax is ~np~code~/np~. This worked in my check through several edit/save cycles. The syntax is listed in the help section at the bottom of the wiki edit page.

Tags are being stripped out in this reply, though. I don't know what the difference is between this site and my test sites.

-- Gary


posts: 2

yeah, my original post had the tags munged as i was describing, so let me try this again.

i've spaced out the characters that make up the html escaping of the html tags in the following, so you will have to extrapolate how the browser is supposed to render the code:

Copy to clipboard
& l t ; dst:criteria & g t ; & l t ; dst:content & g t ; & l t ; /dst:content & g t ; & l t ; /dst:criteria & g t ;


If i remove the spacing, then the browser renders the xml tags, but on saving it again the escaped html tags get converted into the HTML characters they represent, with the result that the next time the page is rendered, the browser attempts to process the tags as html.

Using the np approach doesn't affect the escaped characters; i'm not trying to stop code logic from executing or wiki logic from executing, i'm trying to keep html/xml tags rendering on the page and not processed by the browser.

what tikiwiki needs is a way to escape single characters and that works even if other wiki syntax is not processed. I can use the numeric escaping ~ 6 0 ~ dst:criteria ~ 6 2 ~ (with spaces so you can see the code), but that will NOT work inside np tags.

I hope this makes more sense, but this is precisely the problem: maintaining escaped HTML.

thanks,
--derek