Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-39688

Monospace inline rendering using curly braces

    XMLWordPrintable

Details

    Description

      I recently tried to insert various regular expressions as samples inside an issue description, and noticed that the {{ curly brace markup }} (used for inline monospaced text; as opposed to block monospaced text using the {code} and {noformat} markup) behaves a bit strange when using curly braces inside the text (such as a regex).
      This might be related to JRA-38048, but that one was closed since it seemingly related to just the inconsistent preview. However, the problem also shows in the actual issue description (and possibly other fields/comments).

      Maybe a quick sample:

      Use the regex {{\[A-Z0-9\]\{4,20\}}} for your validator.

      Expected would be that the string "[A-Z0-9]{4,20}" is shown as monospaced text. What actually happens is that "[A-Z0-9]{4,20" is monospaced, followed by a single } - and this looks a bit odd considering that the first of the 3 braces was escaped, while the latter 2 were not.
      As a user, I assumed that escaping also breaks the use for the markup parser, leaving } as verbatim brace while the rest }} is used as end-marker for the inline monospace.

      Trying out other ways of escaping does not seem to work correctly (such as adding backslashes, spaces or other characters that might be hidden in output):

      • [A-Z0-9]{4,20} (monospaced, but ends early)
      • {{[A-Z0-9]{4,20}\ }} (not monospaced, extra backslash and space)
      • {{[A-Z0-9]{4,20}
        }} (not monospaced, extra newline)
      • {{ [A-Z0-9]{4,20} }} (not monospaced, extra space)
      • [A-Z0-9]{4,20} (monospaced, but ends early; this is actually matching the output as I'd be expecting the last brace to be used as-is)
      - {{\[A-Z0-9\]\{4,20\}}} (monospaced, but ends early)
      - {{\[A-Z0-9\]\{4,20\}\ }} (not monospaced, extra backslash and space)
      - {{\[A-Z0-9\]\{4,20\}\\}} (not monospaced, extra newline)
      - {{ \[A-Z0-9\]\{4,20\} }} (not monospaced, extra space)
      - {{\[A-Z0-9\]\{4,20}}\} (monospaced, but ends early; this is actually matching the output as I'd be expecting the last brace to be used as-is)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              e1e73c45da94 Emanuel Wlaschitz
              Votes:
              26 Vote for this issue
              Watchers:
              25 Start watching this issue

              Dates

                Created:
                Updated: