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

Allow MD reformatting before rendering to HTML

Open dmoidl opened this issue 5 years ago • 0 comments

Is your feature request related to a problem? Please describe. I need to render given markdown to HTML. I'd like to use the Formatter to format the input prior to it being rendered as HTML. At the moment it looks like I have to render the formatted MD to String and then parse it again and render as HTML.

Describe the solution you'd like It would be great if the Formatter could only manipulate the AST so that it could be rendered afterwards using some other renderer. I can imagine it having a method like public Document format(Document input) { ... }

Describe alternatives you've considered I considered rendering the formatted markdown to String first and then parsing it again and rendering it as HTML, but the second parsing bothers me as it is technically unnecessary.

Additional context

dmoidl avatar Jul 14 '20 14:07 dmoidl