BNF for WebRender (Jira) formatting?

antekone May 26, 2023

Is there anything like some specification (e.g. BNF) of the Jira formatting syntax? For example, I'd like to see what are the rules why sometimes * can be used to set bold text, and sometimes only {*} works.

1 answer

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 26, 2023

Hello @antekone 

I think the links in this article might be what you're looking for.

https://confluence.atlassian.com/adminjiraserver/configuring-renderers-938847270.html

antekone May 29, 2023

Thanks for the reply. I don't see any formal specifications for the formatting language though. There are of course some examples how to use it, but they are not formal (can't use it to write a fully conformant parser).

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 29, 2023

Following the link in that document to the Wiki Style Rendering section reveals another link

"A full notation guide can be found here."

Is that subsequent page not the information you seek?

Perhaps if you provide more information about and an example of exactly what you need and the problem you are trying to solve, we can provide a better answer.

antekone May 30, 2023

Yes, I've seen the document. It's entirely sufficient when wanting to learn how to use the formatting from the user perspective. The thing is that I'm researching how to write a fully conformant parser for the language. This means that I need a little bit more information than this document has; for example:

  • in the web page you've linked there are no mentions about additional formatting commands like {*}, {_}, (there are commands without { and } like *, _, but from the perspective of a language parser those need to be parsed differently),
  • there are different rules for interpretation of text formatting tokens, like i.e. "*{code}some code{code}*" will produce a completely different outcome than i.e. "*{quote}some quote{quote}*". In the first case, the "bold" token will be ignored and stars will be printed out, but in the second case, bold will be applied to the whole quote. This is not addressed in the website you've linked,
  • there is no definition what "start of the line" actually means. For example, when I type:
    {color:red}
    h1. header
    {color}

    This will fail to produce the header line, and will output "h1. header" text in red. But when I do this with another command:
    {quote}
    h1. header
    {quote}

    This will properly output the "header" text using header style (increased font size), together with quoted style. Both uses of "h1" are conformant to the "beginning of the line" requirement, but they're still interpreted differently using rules that are not described in the document you've pasted,
  • there are also other edge cases, but I hope the examples I've provided above give you enough context.

Writing parsers is much easier when there are formal rules written out in a language called BNF, or some other language which is similarily strict. The website you've linked, while very helpful for normal users, does not have enough information to write a fully conformant parser. It's possible to write *some* parser for the language using this info plus empirical experimentation using Jira itself, but I'm currently researching if it's possible to write a *fully conformant* parser.

Suggest an answer

Log in or Sign up to answer