Hi,
im would like to convert some HTML into Jira-Markdown, so i was trying to combine the FlexmarkHtmlConverter
with the JiraConverterExtension
.
To test it i would use the creation of image links, because jira expects them to have a closing !
.
So a <p><img src="/url" alt="foo" title="title" /></p>
should become a ![foo](/url "title")!
instead of a ![foo](/url "title")
.
Sadly, looking through the documentation i found on github and inside the test-code i am not sure how to correctly combine the extension with the coverter. The Converter seems to ignore the extension.
I tried to pass it like this
final DataHolder options = new MutableDataSet()
.set(Parser.EXTENSIONS, List.of(JiraConverterExtension.create()))
.toImmutable();
final String withJiraExtension = FlexmarkHtmlConverter
.builder(options)
.build()
.convert(HMTL_SAMPLE);
and also like this
final String withJiraExtension = FlexmarkHtmlConverter
.builder(options)
.extensions(Set.of(JiraConverterExtension.create()))
.build()
.convert(HMTL_SAMPLE);
Did i do it wrong?
Does is this combination incompatible?
Should i parse the html to the AST and then output the AST to jira? How would i do that?