"do text from text('a < b')" fails

Bug #778728 reported by Luc Saffre
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Appy
Fix Released
Undecided
Unassigned

Bug Description

The appy.pod.renderer.Renderer.renderText() method fails if the string to be rendered contains characters like '<' or '&' that are no valid XML tags.

One solution would be to insert a line

  text = cgi.escape(text)

before the line

  text = text.replace('\r\n', '<br/>').replace('\n', '<br/>')

in that function (and import the `cgi` module at the top of the file).

Note that this would change the current behavious for usages like

  do text
  from text('This\nis a <b>formatted</b>\nmultiline text

where the "<b>" would be rendered as text instead of having the word "formatted" in bold.
But IMHO such use cases anyway make not much sense, so I'd say that my suggestion is okay.

Luc

Revision history for this message
Gaëtan Delannay (gaetan-delannay) wrote :

Hi Luc,
Fix was committed, thank you !
http://bazaar.launchpad.net/~appy-dev/appy/trunk/revision/154
G

Changed in appy:
status: New → Fix Committed
Changed in appy:
milestone: none → 0.6.7
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.