Edgewall Software
Modify

Ticket #4379 (closed defect: worksforme)

Opened 5 years ago

Last modified 2 years ago

ticket wiki formatting error

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

Description (last modified by cboos) (diff)

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 [[br]] 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

comment:1 Changed 5 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[\]]*" 

comment:2 Changed 5 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

comment:3 Changed 5 years ago by Noah Kantrowitz <coderanger@…>

I think suggestion was:

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

comment:4 Changed 5 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.

comment:5 Changed 5 years ago by cboos

  • Milestone set to 0.10.4
  • Severity changed from normal to minor

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]]"?

comment:6 Changed 5 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.

comment:7 Changed 5 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.

comment:8 Changed 5 years ago by cboos

  • Milestone changed from 0.10.5 to 0.12

comment:9 Changed 2 years ago by cboos

  • Description modified (diff)
  • Milestone next-major-0.1X deleted
  • Resolution set to worksforme
  • Status changed from new to closed

Well, I don't see what's left to do with this ticket...

For people not wanting WikiFormatting, there's the code block:

{{{

}}}

which can even be inserted from the wiki "tool bar".

For using [ and ] in links (comment:6), there are alternative syntaxes:
<http://asd]asd> (<http://asd]asd>) and [[http://asd]asd]] (http://asd]asd) (soon, #4356).

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from jonas. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.