I noticed that Hansfn has done a great job by combining a bunch of comments
into one finished tip at:

http://vim.wikia.com/wiki/Wrap_text_in_HTML/XML_tags_after_prompting_for_the
_tag_name

I thought I would fix an indent for an 'if'. Then I started to wonder if a
long block of code, as in this tip, should use <pre> tags rather than a
space prefix on each line.

Then I learnt something that others might like to know...

The wiki interprets <pre> like this (I found this documented):
    <pre> = <nowiki> and HTML <pre>
    Content will not be parsed and is preformatted.
    Uses fixed-width font, exactly as laid out (NOT ignoring whitespace).
    Special characters like &lt; are interpreted normally.

Using <pre> will work with code like this:
    let newline = ''

But, if you just prefix the line with a space, the wiki interprets the '' as
italics and it displays:
    let newline =

That is, using a space prefix can BREAK code.

Also, when a reader copies text from a tip, if the tip used <pre> then you
do not get an irritating space appended to each line (you do get that
trailing space if a prefix space was used).

I guess I should add this to a guideline somewhere...

John

_______________________________________________
Vim-l mailing list
[email protected]
http://lists.wikia.com/mailman/listinfo/vim-l

Reply via email to