#1447 Fix error about adding tags

v1.0.0
closed
Wolf
sf-2 (994)
General
nobody
2015-08-20
2011-02-04
No

This appears in the logs when editing a ticket, but everything seems to work fine.

17:57:12,620 ERROR [allura.lib.markdown_extensions] Error adding <br> tags: new text is <p>abc<br/>defxjgimwge:artifact:0000</p>
Traceback (most recent call last):
 File "/home/dbrondsema/dbrondsema-7024/forge/Allura/allura/lib/markdown_extensions.py", line 300, in run
   new_node = markdown.etree.fromstring(new_text)
 File "<string>", line 85, in XML
SyntaxError: not well-formed (invalid token): line 1, column 15

Discussion

  • Dave Brondsema

    Dave Brondsema - 2011-04-07

    This is making our error reports very cluttered

     
  • Dave Brondsema

    Dave Brondsema - 2011-04-07
    • milestone: limbo --> apr-14
     
  • Dave Brondsema

    Dave Brondsema - 2011-04-07
    • size: --> 2
     
  • Jenny Steele - 2011-04-08
    • status: open --> in-progress
    • assigned_to: Jenny Steele
     
  • Jenny Steele - 2011-04-11

    Turns out this was actually a problem with displaying markdown containing html tags that weren't closed, such as img tags. I fixed it by passing the text through beautiful soup to be tidied up if the xml parser couldn't figure it out. To test, save something like this for your project description and make sure a br tag shows up between the img and the text when it's rendered:

    <img src="icon" border="0">
    <b>text</b>

    • assigned_to: Jenny Steele --> Wolf
     
  • Jenny Steele - 2011-04-11
    • status: in-progress --> code-review
     
  • Wolf - 2011-04-11
    • status: code-review --> closed
     
  • Wolf - 2011-04-11

    tested as Jenny recommended and that worked, merged to dev at 47e2a0b. Did not check the logs for ticket editing

     

Log in to post a comment.