Pasting markup on the Wiki

Anything that looks like HTML will be interpreted as such by the Wiki software.

As such, if you wish to paste code (for example between opening and closing <pre> tags), then you must preformat it.

A simple way to do this at the command line is as follows, with $file replaced by the file you wish to format.

sed 's/\&/\&amp;/g' $file | sed 's/</\&lt;/g' | sed 's/>/\&gt;/g'

This first replaces ampersands with &amp;, and then replaces the less-than and greater-than characters with the appropriate ampersand-denoted equivalents. You can then copy the output of the command and paste it on a Wiki page.

Topic revision: r1 - 2010-03-08 - TerryVaskor
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback