Edgewall Software
Modify

Opened 17 years ago

Closed 14 years ago

#4379 closed defect (worksforme)

ticket wiki formatting error

Reported by: chris.alex.thomas@… Owned by: Jonas Borgström
Priority: normal Milestone:
Component: wiki system Version: 0.10.2
Severity: minor Keywords:
Cc: chris.alex.thomas@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Christian Boos)

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 (0)

Change History (9)

comment:1 by Tim Hatch <trac@…>, 17 years ago

Component: ticket systemwiki

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 by chris.alex.thomas@…, 17 years ago

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 by Noah Kantrowitz <coderanger@…>, 17 years ago

I think suggestion was:

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

comment:4 by chris.alex.thomas@…, 17 years ago

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 by Christian Boos, 17 years ago

Milestone: 0.10.4
Severity: normalminor

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 by Tim Hatch <trac@…>, 17 years ago

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 by Christian Boos, 17 years ago

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 (asdasd]), as the first ] seen will close the so-called LHREF link.

comment:8 by Christian Boos, 17 years ago

Milestone: 0.10.50.12

comment:9 by Christian Boos, 14 years ago

Description: modified (diff)
Milestone: next-major-0.1X
Resolution: worksforme
Status: newclosed

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).

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.