Tags:
create new tag
, view all tags

Bug: Verbatim on single line has problems, and square bracket link with ampersand has problems

  1. Double square bracket breaks with & inside
  2. Double square bracket link can't be Verbatim?
  3. verbatim on single line doesn't verbatim?

Test case

  • 1A

this is a verbatim <b>code snippet</b> which works ok

"Raw" text of above:

<verbatim>
this is a verbatim <b>code snippet</b> which works ok
</verbatim>

  • 1B

this is a verbatim <b>code snippet</b> which does not

"Raw" text of above:

<verbatim>this is a verbatim <b>code snippet</b> which does not</verbatim>

  • 2A

wierd & strange forced link breaks here due to ampersand?

"Raw" text of above:

[[wierd & strange forced link breaks here due to ampersand]]

  • 2B

[[wierd & strange forced link breaks inside verbatim on single line]]

"Raw" text of above:

<verbatim>[[wierd & strange forced link breaks inside verbatim on single line]]</verbatim>

  • 3A

[[wierd & strange forced link is shown verbatim when tags are on seperate lines]]

"Raw" text of above:

<verbatim>
[[wierd & strange forced link is shown verbatim when tags are on seperate lines]]
</verbatim>

  • 3B

[[and also, forced links are still linked inside verbatim but maybe due to the single line verbatim problem]]

"Raw" text of above:

<verbatim>[[and also, forced links are still linked inside verbatim but maybe due to the single line verbatim problem]]</verbatim>

Environment

twiki.org

TWiki version: twiki.org's version
TWiki plugins:  
Server OS:  
Web server:  
Perl version:  
Client OS: W2k
Web Browser: IE 5.5

-- JonathanCline - 10 May 2003

Follow up

I added "raw text" versions of the lines in question so we can compare the markup and results more easily, then I piggybacked a related question:

I have what may be a related problem over on Wikilearn.XafEventsC. Over there, I copied in a lot of c code and put it all within verbatim tags. Then, I wanted to create links within that verbatim section using the the double square bracket syntax, so I did something like this on any line where I wanted such a link:

#include "</verbatim> X.h? <verbatim>"

So, from a higher level of view, I had a section like this:

<verbatim>
lots of lines of code
...
#include "</verbatim> X.h? <verbatim>"
more lines of c code
...
</verbatim>

Note that it appears to work above (the ? appears), because the verbatim tags in the above section are not "real". Here is the same section with real verbatim tags:

lots of lines of code
...
#include "
X.h?
"
more lines of c code
...

I tried the link syntax in a variety of ways, with and without the whitespace around it, and also as X.h? which had a different set of problems. In none of the trial could I get the link to be recognized as a link (no question mark).

Any idea why / a workaround?

Ahha! I think I just answered my own question. TWiki apparently recognizes a verbatim tag correctly only when it's on a separate line by itself. Thus, to do what I was trying to do, I'd have to do something like:

<verbatim>
lots of lines of code
...
#include "
</verbatim>
X.h?
<verbatim>
"
more lines of c code
...
</verbatim>

Which, using "real" verbatim tags, comes out like this:

lots of lines of code
...
#include "
X.h?
"
more lines of c code
...

Which, while it makes the link work, makes the C code very hard to read. I guess the C code might work because C (IIRC) doesn't care about whitespace (doesn't care how much or how little), but this is not the result I'm looking for.

-- RandyKramer - 10 May 2003

Ok, I sort of answered one of the questions: <verbatim> tags in TWiki only work properly when they are on separate lines. Now the followups:

  • Why?
  • Is that the way TWiki should work?

Furthermore, I have not even touched on the other question: "square bracket link with ampersand has problems".

And, I may have missed some other questions implied in JonathanCline's examples above.

And, I have one more question of my own — do <verbatim> tags sometimes work when not on separate lines?

-- RandyKramer - 10 May 2003

I set this to N/A since TWiki requires the verbatim and pre tags to be on a line by itself.

-- PeterThoeny - 23 Jul 2004

Fix record

Topic revision: r3 - 23 Jul 2004 - 07:39:39 - PeterThoeny
 
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback