Loading...
 
Skip to main content

Features / Usability


How to paste code/XML into wiki and *not* have it get mutilated?

I'm trying to paste code/XML into my TikiWiki and it's getting mutilated. I'm using
 and 
to make pre-formatted text which shouldn't get touched by the wiki. I'm pasting this:








XYZ State University
XYZ State University
Keith
Palmer


But then when I edit it, it gets changed to this:







XYZ State University
XYZ State University
Keith
Palmer



Note the extra ""s in there and how it changed "stoponerror" to "stoponerror" (lowercase).

What the heck? How do I fix this?

I considered using the
Copy to clipboard
tag or something, but I can't figure out how to install that plugin...?
...great, and now the forums don't let me paste XML either...

Image
Copy to clipboard
XYZ State University XYZ State University Keith Palmer



gets incorrectly changed to:

Image
Copy to clipboard
XYZ State University XYZ State University Keith Palmer

How the heck do I post XML...? Uuuugggh...

As far as I know the only thing you can do is to replace all angle brackets with Wiki syntax equivalent codes, which would be ~60~ for less than (<) and ~62~ for greater than (>). You should then be able to use the {CODE} plugin. Such that the following code:

Copy to clipboard
~60~recipe name="bread" prep_time="5 mins" cook_time="3 hours"~62~ ~60~title~62~Basic bread~60~/title~62~ ~60~ingredient amount="8" unit="dL"~62~Flour~60~/ingredient~62~ ~60~ingredient amount="10" unit="grams"~62~Yeast~60~/ingredient~62~ ~60~ingredient amount="4" unit="dL" state="warm"~62~Water~60~/ingredient~62~ ~60~ingredient amount="1" unit="teaspoon"~62~Salt~60~/ingredient~62~ ~60~instructions~62~ ~60~step~62~Mix all ingredients together.~60~/step~62~ ~60~step~62~Knead thoroughly.~60~/step~62~ ~60~step~62~Cover with a cloth, and leave for one hour in warm room.~60~/step~62~ ~60~step~62~Knead again.~60~/step~62~ ~60~step~62~Place in a bread baking tin.~60~/step~62~ ~60~step~62~Cover with a cloth, and leave for one hour in warm room.~60~/step~62~ ~60~step~62~Bake in the oven at 180(degrees)C for 30 minutes.~60~/step~62~ ~60~/instructions~62~ ~60~/recipe~62~

Is translated as:

Copy to clipboard
~60~recipe name="bread" prep_time="5 mins" cook_time="3 hours"~62~ ~60~title~62~Basic bread~60~/title~62~ ~60~ingredient amount="8" unit="dL"~62~Flour~60~/ingredient~62~ ~60~ingredient amount="10" unit="grams"~62~Yeast~60~/ingredient~62~ ~60~ingredient amount="4" unit="dL" state="warm"~62~Water~60~/ingredient~62~ ~60~ingredient amount="1" unit="teaspoon"~62~Salt~60~/ingredient~62~ ~60~instructions~62~ ~60~step~62~Mix all ingredients together.~60~/step~62~ ~60~step~62~Knead thoroughly.~60~/step~62~ ~60~step~62~Cover with a cloth, and leave for one hour in warm room.~60~/step~62~ ~60~step~62~Knead again.~60~/step~62~ ~60~step~62~Place in a bread baking tin.~60~/step~62~ ~60~step~62~Cover with a cloth, and leave for one hour in warm room.~60~/step~62~ ~60~step~62~Bake in the oven at 180(degrees)C for 30 minutes.~60~/step~62~ ~60~/instructions~62~ ~60~/recipe~62~


You can do this fairly easily by pasting the original XML in your favorite text editor and performing a simple "search and replace".


Ahh... well in that case... I think I'll just use MediaWiki instead, where I can just paste it in and have it magically work correctly.
Magic is fun! 😊