wiki markup gets confused when unknown macro markup is interleaved with valid markup

XMLWordPrintable

    • 4.04

      If you inadvertently write text that "looks like" a wiki macro (but isn't) JIRA tries to behave sensibly:

      e.g.

      {foobar}noway{foobar}

      gets displayed as-is.

      However, JIRA gets very confused if you start interleaving valid macro tags with those invalid macro tags:

      {foobar}{code}{foobar}{code}
      

      The user doesn't mean for "foobar" to be a macro so they expect the above to generate something like

      {foobar}

      {foobar}

      In the trivial examples above you just think "well, duh, obviously you are using stuff that looks like a macro to JIRA so it will get confused". But in a real world example it will be a JIRA description or comment with a lot more text:

      Lorem ipsum dolor sit amet, {foobar}consectetur adipiscing elit. Morbi id ullamcorper odio. Ut semper rutrum dui, eu blandit erat congue vitae. Suspendisse aliquet metus eget ante congue sed pretium urna ultricies. Phasellus imperdiet dui at odio fringilla adipiscing. Curabitur quis quam ac nisi adipiscing vestibulum at ut tortor. Sed mollis, ligula id vehicula suscipit, est nulla aliquet mi, sed tincidunt augue diam et est. Cras ac elit nec augue sollicitudin eleifend. In facilisis consectetur neque, nec consectetur velit cursus et. Vivamus interdum ante at urna mattis congue. Vestibulum a dolor dolor, vitae feugiat arcu. Nulla tincidunt sodales nunc, sit amet imperdiet odio blandit eget. Morbi blandit mollis libero quis sagittis. Sed tempus lacinia eleifend. Curabitur fermentum fermentum hendrerit. In auctor sem ac velit fermentum sed scelerisque tortor dictum. Praesent eu massa vitae leo tristique commodo. Duis in turpis leo.
      
      {code}
      Proin eget quam vel ligula iaculis semper et eget purus. Vivamus pharetra, velit in malesuada faucibus, mauris turpis suscipit justo, nec rutrum eros metus vel mauris. Mauris ultricies condimentum felis {foobar} vitae malesuada. Fusce faucibus rhoncus facilisis. Cras venenatis vehicula quam sed sollicitudin. Cras vitae lacus quis enim malesuada aliquet sed id neque. Cras consectetur leo sit amet nisi venenatis feugiat rutrum justo dictum. Vestibulum imperdiet, velit in cursus feugiat, turpis magna congue sem, eget adipiscing eros tortor sit amet risus. Vestibulum ut nibh nulla. Sed ac est nulla. 
      {code}
      

      In that case it isn't so clear what you've done wrong to confuse JIRA.

      The reason we get into this case is because wiki-markup is based off of regular expressions and string matching and so forth.

      The renderer sees {foobar} and looks for a matching close tag. It finds it then discovers there is no such {foobar} macro. It then renders the text contained between those two tags. In this case, it is the single tag {code}. It doesn't find a matching close tag in the subcontent and then everything gets very confused.

      These are the reasons that Confluence has ditched wiki markup for their new XHTML storage format. It seems likely to me that fixing this behaviour is quite a lot of effort that, in the end, would be better addressed by following Confluence's lead.

            Assignee:
            Unassigned
            Reporter:
            Justus Pendleton (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: