Modify

Opened 3 years ago

Closed 2 years ago

Last modified 2 years ago

#9633 closed defect (worksforme)

Breaks when special characters (like , or [[) in message

Reported by: riot Owned by: rjollos
Priority: high Component: NoteBoxMacro
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description (last modified by rjollos)

If you try to add a comma or other special characters like a link inside a NoteBox, either the message will be broken off or (in case of [[) only half of the text will be displayed entirely without notebox.

I tried enclosure in ", ', """ - yet nothing helped. Some overeager parser trying to split macro arguments here, maybe?

Attachments (2)

Example.png (24.6 KB) - added by rjollos 2 years ago.
NoteBoxWithNoteBox.png (14.5 KB) - added by rjollos 2 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 Changed 3 years ago by riot

  • Summary changed from Breaks text upon special characters (like , or [[) to Breaks when special characters (like , or [[) in message

Change: better summary.

PS: Can someone change the reported by field to my username? Probably less spam, that way. Sorry.

comment:2 Changed 2 years ago by rjollos

  • Reporter changed from riot@… to riot

comment:3 Changed 2 years ago by rjollos

  • Owner changed from gruenebe to rjollos
  • Priority changed from normal to high
  • Severity changed from critical to normal

Changed 2 years ago by rjollos

comment:4 Changed 2 years ago by rjollos

  • Resolution set to worksforme
  • Status changed from new to closed

Following [10070], we using parse_args from the Trac API for parsing the input arguments. It should be useful to take a look at the documentation: here. [11211] might have improved the situation as well. I'm currently testing r11211 in a dev environment with Trac 0.11.0.

Based on my testing, the only character we need to escape is a comma, and it must be escaped with a backslash. I'll add some documentation to the wiki page about this.

The following example works fine for me:

[[NoteBox(tip,Hey\, you know you can use the `[[NoteBox]]` macro for many things!!! ! @ # $ % !^ & * ( ) - + = [[. '''Don't''' worry about special chars\, they are no problem! Just escape your commas \\, and backslashes \\. Everything else will be interpreted as normal wiki markup.)]]

The problem you could run into though, is that everything in text passed to the NoteBox macro is interpreted as wiki markup. So if you put the text [[NoteBox]] in your sentence, it will render a warning just as it would in any other location in a wiki page.


Please reinstall the latest version and send me the specific markup if you can produce a situation that doesn't yield the expected results.

I'm resolving this is worksforme for now, though your report may have been valid prior to [11211].

Changed 2 years ago by rjollos

comment:5 Changed 2 years ago by rjollos

  • Description modified (diff)

comment:6 Changed 2 years ago by rjollos

I've found a situation that doesn't work. It doesn't appear to be possible to embed macros within macros. For example,

[[NoteBox(tip,You can even put a [[NoteBox(note,!NoteBox)]] within a !NoteBox)]]


However, to address this situation, I think it needs to be fixed in the Trac API. I vaguely remember reading about this in a Trac ticket. I'll make a note to investigate this and open a ticket in Trac if no one has brought this up already. As noted, I'm testing with Trac 0.11.0, so this could even have been improved already in a later version.

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from rjollos. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.