Hi Maksymilian,
thank you very much, that is great! For sure something I can use it.
I have still two questions:
- In markdown I can use easily "formatted stuff", e.g. tables or Mermaid diagrams, which is not working here. Is this a matter of the converter or is this a limitation of the HTML field? Or could these features somehow be supported?
- In fact I was looking for the "reverse" formatting, i.e. I enter in a multiline field with configuration "rich" a formatted Text and the content is converted into valid markdown. Is this possible, too?
Kind regards,
Klaus
I don't have great answers to those unfortunately.
1. a) It will be easy to add support for tables - you could just change markdown flavour to GFM - https://showdownjs.com/docs/flavors/
1. b) Mermaid is not really a default markdown feature - it's additional library - you could try also adding it using cdn library with mermaid.js -https://github.com/mermaid-js/mermaid - from my testing it looks like this won't work even with regular multi-line fields, as those add <p> tags to create new lines - you could try to remove them though before calling render.
2. In theory showdown.js can convert markdown -> html and html -> markdown, but i highly doubt that this will work good - don't see a chance that webcon formatter uses same html tags as showdown.js.
I've added HTML -> markdown to the PoC application.
Maybe there is some library which could be used to create custom field on webcon form with all the features, but i'm not aware of it.