Edgewall Software

Ticket #4379 (new defect)

Opened 2 years ago

Last modified 21 months ago

ticket wiki formatting error

Reported by: chris.alex.thomas@… Owned by: jonas
Priority: normal Milestone: 0.13
Component: wiki system Version: 0.10.2
Severity: minor Keywords:
Cc: chris.alex.thomas@…

Description

I just created a ticket in my installation and I found this error.

I wanted to imput the text

bl:description[[br]]
rm:description[[br]]

and the wiki formatter for some reason doesnt like this and failed to process the
as line breaks, and basically the text I put into the ticket change history, output in the wiki page when it reloaded, also, the line break didnt occur either.

so I think that some types of text combinations can cause the wiki to be confused.

is it possible to just turn off the wiki processing completely and just store the raw text, cause most of the time, I don't care about it and sometimes it just gets in my way when I don't want fancy markup, I just want a raw text entry box to type into.

Attachments

Change History

Changed 2 years ago by Tim Hatch <trac@…>

  • component changed from ticket system to wiki

This specific misformat is because it thinks the [] are part of a TracLink with the prefix bl: or rm:, respectively. The simple way around this is add a space between the bl:description and the [[br]] which will cause TracLink parsing to cease, then detect the macro correctly.

One way of fixing this that I can stand behind is to specialcase [[ as not allowed in the middle of TracLinks.

  • trac/wiki/formatter.py

     
    175175    QUOTED_STRING = r"'[^']+'|\"[^\"]+\"" 
    176176 
    177177    SHREF_TARGET_FIRST = r"[a-zA-Z0-9/?!#@]" # we don't want "_" 
    178     SHREF_TARGET_MIDDLE = r"(?:\|(?=[^|\s])|[^|<>\s])" 
     178    SHREF_TARGET_MIDDLE = r"(?:\|(?=[^|\s])|[^|<>\[\s]|\[(?!\[))" 
    179179    SHREF_TARGET_LAST = r"[a-zA-Z0-9/=]" # we don't want "_" 
    180180 
    181181    LHREF_RELATIVE_TARGET = r"[/.#][^\s[\]]*" 

Changed 2 years ago by chris.alex.thomas@…

sounds like a better plan than reformatting my text to fix the wiki parser.

doing

bl: description[[br]]

is not the same and well, I am sure you agree, making me sidestep the wiki parsers bugs aint a good solutions.

thanks, hope this fix reaches 10.3 :D

Changed 2 years ago by Noah Kantrowitz <coderanger@…>

I think suggestion was:

bl:description [[br]]
rm:description [[br]]

Changed 2 years ago by chris.alex.thomas@…

ahhhhh, I see, ok, well thats better, but still, his fix takes care of that and the other case where you don't have a space if I understood his fix correctly.

Changed 2 years ago by cboos

  • severity changed from normal to minor
  • milestone set to 0.10.4

Well, as we don't allow "]" in a SHREF, we probably could forbid use of "[" as well.

If such a character is really needed, one can always use the quoting, as in wiki:"description[[br]]"?

Changed 2 years ago by Tim Hatch <trac@…>

Where does it say ] is not allowed in SHREF? I think mine allows it... http://asd]asd

[ is used for PHP forms that have multiselect boxes, so I think a single one (not a pair) should be allowed. Something like ...?var[1]=on&var[2]=on is quite normal.

Changed 2 years ago by cboos

I was talking about the regexp for wiki:asd]asd?, but obviously I was also wrong in that case ;)

So it's only for [wiki:asd]asd] where it's currently not possible to have that (asd?asd]), as the first ] seen will close the so-called LHREF link.

Changed 21 months ago by cboos

  • milestone changed from 0.10.5 to 0.12

Add/Change #4379 (ticket wiki formatting error)

Author



Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will change from jonas. Next status will be 'new'
The owner will change from jonas to anonymous. Next status will be 'assigned'
 
Note: See TracTickets for help on using tickets.