Hello all,
question concerning markup/parser:
In a <pre> section, all markup is preserved (not interpreted), except for <nowiki>....</nowiki> tags. So
<pre> text <b>bold?</b> </pre>
gets rendered as
text <b>bold?</b>
(that's what I expected), whereas
<pre> text <nowiki>bold?</nowiki> </pre>
gets rendered
text bold?
Isn't this inconsistent? Or is this intentional behaviour? I am asking, because I write a mediawiki markup parser in Ruby and like to get things 'right' (whatever that means).
Patrick
<pre> Some '''bold''' text </pre>
...should be rendered fine.
Rob Church
On 2 Nov 2005 17:23:40 +0100, Patrick Gundlach pg@levana.de wrote:
Hello all,
question concerning markup/parser:
In a <pre> section, all markup is preserved (not interpreted), except for <nowiki>....</nowiki> tags. So
<pre> text <b>bold?</b> </pre>
gets rendered as
text <b>bold?</b>
(that's what I expected), whereas
<pre> text <nowiki>bold?</nowiki> </pre>
gets rendered
text bold?
Isn't this inconsistent? Or is this intentional behaviour? I am asking, because I write a mediawiki markup parser in Ruby and like to get things 'right' (whatever that means).
Patrick _______________________________________________ MediaWiki-l mailing list MediaWiki-l@Wikimedia.org http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
Hi,
<pre> Some '''bold''' text </pre>
...should be rendered fine.
Well, I asked why the first level of a <nowiki> tag is interpreted (i.e. discarded) in a <pre> environment. This is contradicting the statement (in the help page - can't remember the exact URL) whereas in <pre> no tags get interpreted.
Patrick
Patrick Gundlach wrote:
Well, I asked why the first level of a <nowiki> tag is interpreted (i.e. discarded) in a <pre> environment. This is contradicting the statement (in the help page - can't remember the exact URL) whereas in
<pre> no tags get interpreted.
<nowiki> gets interpreted before <pre>. Nested extension tags aren't really handled as they should be at present.
-- brion vibber (brion @ pobox.com)
On 3 Nov 2005 09:43:36 +0100, Patrick Gundlach pg@levana.de wrote:
Well, I asked why the first level of a <nowiki> tag is interpreted (i.e. discarded) in a <pre> environment. This is contradicting the statement (in the help page - can't remember the exact URL) whereas in
<pre> no tags get interpreted.
Well, the documentation is subtly wrong, simply because whoever wrote it had never tried this particular combination nor, probably, looked at the code (which, at the end of the day, is the ultimate documentation). Looking at that code, there is a rather more surprising and important exception, in that currently <math> gets processed before (and therefore even inside) <pre> as well, which might be worth documenting.
-- Rowan Collins BSc [IMSoP]
[nowiki and math inside pre]
Thanks Brion and Rowan for clarification.
Regards,
Patrick
On 2 Nov 2005 17:23:40 +0100, Patrick Gundlach pg@levana.de wrote:
question concerning markup/parser:
In a <pre> section, all markup is preserved (not interpreted), except for <nowiki>....</nowiki> tags. So
Isn't this inconsistent? Or is this intentional behaviour? I am asking, because I write a mediawiki markup parser in Ruby and like to get things 'right' (whatever that means).
Well, it's not inconsistent, exactly, it's just what you might call "markup precedence": because of the way the "parser" is coded, no 2 actions can happen "at the same time", and processing proceeds by type, not position, so combinations will only ever "happen" one way round.
If I remember the code rightly, <nowiki> tags are the very first thing to be processed, because by definition their content needs to be hidden from all other processing [looking, it seems only the optional <html> gets done earlier]. Presumably, <pre> gets processed straight after, since it has the same properties, but since it also acts as an HTML <pre>, it's not the same, so can't be done at *exactly* the same time. So <nowiki> ends up "having precedence over" <pre>, whichever way round you nest them; by the time the <pre> tags get processed, the <nowiki> has already been processed and vanished.
Admittedly, if you were designing the markup on logical grounds, that wouldn't make a whole lot of sense, but it's certainly expressable as a consistent rule.
-- Rowan Collins BSc [IMSoP]
mediawiki-l@lists.wikimedia.org