Fossil

View Ticket
Login
Ticket UUID: 59da623c11206852f51c501a3df0ded6291dbee4
Title: nowiki tag limitations
Status: Open Type: Code_Defect
Severity: Cosmetic Priority: Low
Subsystem: Resolution: Open
Last Modified: 2014-05-31 18:53:58
Version Found In: 1.28 [3d49f04587]
User Comments:
anonymous added on 2014-05-30 02:51:22:
The nowiki tag does not seem to work if it is the first line in a file.

Moreover, multiple nowiki tags don't seem to work properly.
For example, in the following WIKI+HTML, the first table is fine,
but in the second the <hr> tag, Option" ends up with <p> tag in it
which causes an the header to be very tall.

BTW: fossil is great.

Regards,
Peter
--------------------
Some
<nowiki>
<table border='1'>
<tr><th>Option</th><th>Description</th></tr>
<tr><td>A</td><td>B</td></tr>
</table>
</nowiki>
More

<nowiki>
<table border='1'>
<tr><th>Option</th><th>Description</th></tr>
<tr><td>A</td><td>B</td></tr>
</table>
</nowiki>

------------
<p>Some

<table border="1">
<tr><th>Option</th><th>Description</th></tr>
<tr><td>A</td><td>B</td></tr>
</table>

More 


<table border="1">
<tr><th><p>Option</th><th>Description</th></tr>
<tr><td>A</td><td>B</td></tr>
</table>
--------------------

stephan added on 2014-05-30 10:27:05: (text/x-fossil-wiki)
NOWIKI does _not_ block normal HTML Tags, only wiki-specific markup (braces and such).

i'll take a look at the no-effect-on-the-first-line bit this weekend (sounds like an off-by-one, but it might just be a misunderstanding of what nowiki is supposed to do). i use multiple NOWIKI tags in pages very often with no problems.

anonymous (claiming to be peter) added on 2014-05-30 13:07:58:
Thanks for the quick response.

To clarify the 2nd problem: NOWIKI is not blocking HTML tags, but rather inserting a <p> tag in the <th>.

Perhaps I misunderstand it's intent, but I thought NOWIKI was designed to not do any wiki processing on a block.

There is no problem using multiple NOWIKI for simple cases. But there is with text nested between other tags.

For most content, inserting <p> tags would not be a problem.
But with tables, a <p> in the <th> causes the height to double.

stephan added on 2014-05-31 16:45:05: (text/x-fossil-wiki)
Hi, thanks for the feedback!

i cannot reproduce a problem with NOWIKI on the first line. The problem regarding the P flag i am going to justify with the following semi-lame explanation: NOWIKI is not really intended to enclose whole block-level structures such as tables, and doing so may cause unwanted side-effects in conjunction with block-level constructs which the parser takes a substantial interest in. i do not have a definitive list of which tags that might be, but i know (e.g.) that PRE inside NOWIKI works fine, while you have demonstrated that a TABLE block (or the TH inside it) is apparently not side-effect-free (in that it generates a spurious P tag).

Here is an example of a page which uses multiple NOWIKI PRE /PRE /NOWIKI blocks without any problems:

[http://fossil.wanderinghorse.net/repos/libfossil/index.cgi/artifact/582cf57813cf8864a636f686d84b29839764cd65]

i'll leave this open for the time being, as the spurious P "really shouldn't" be generated, but any changes to the wiki parser, in particular for edge cases, are not likely to get much priority.

anonymous (claiming to be Peter) added on 2014-05-31 18:53:58:
Ok. Not really looking for problems to be fixed, though. Mostly I opened the bug for the benefit of future fossil wiki users experiencing similar problems

The language in the documentation could perhaps be softened, to wit:

  The <nowiki> tag disables all wiki formatting rules through the matching </nowiki> element

Irregardless, I've found another problem with NOWIKI (below) which (maybe) sheds some light on the first bug. Essentially, it turns out a missing </a> tag for a label is causing the parser go get confused.  The wiki does not recognize the self closing tag (which is fair) but instead reads forward to the other <a> end tag.

Regards, and hope this helps.

------------------------------------------
<nowiki>
<b>START</b>
<a name="MYLAB" />

<table border='1'>
<tr><td>A</td><td>1</td></tr>
<tr><td><a href='#MYLAB'>B</a></td><td>2</td></tr>
<tr><td>C</td><td>3</td></tr>
</table>

<b>END</b>.
</nowiki>
-----------------------------------------
<p><b>START</b>
<a name="MYLAB">

<table border="1">
<tr><td>A</td><td>1</td></tr>
<tr><td></td></tr></table></a><a href="#MYLAB">B</a>2
C3


<b>END</b>.
-----------------------------------------