flexmark-java icon indicating copy to clipboard operation
flexmark-java copied to clipboard

How to parse Jira Wiki Syntax?

Open jpwilhelms opened this issue 3 years ago • 1 comments

I have to convert the Jira Wiki Syntax (https://jira.atlassian.com/secure/WikiRendererHelpAction.jspa?section=all) into Microsoft word elements. My idea was to use flexmark-java with the docx renderer extension. Is there already a parser for the Jira Syntax?

jpwilhelms avatar May 21 '22 07:05 jpwilhelms

For parsing a header line "h1. my heading" I tried different ways:

  • Parser.builder().customBlockParserFactory()
  • Parser.builder().paragraphPreProcessorFactory()
  • Parser.builder().blockPreProcessorFactory()

In each registered factory I identified the "h1." substring, extracted the header text and inserted a Header-Node. When rendering the result as HTML I always get an empty <h1></h1> section.

Could someone please show me the recommended way to convert this "h1. xxxxx" to AST nodes?

jpw-src avatar May 26 '22 09:05 jpw-src