RPTools / maptool

Virtual Tabletop for playing roleplaying games with remote players or face to face.
http://rptools.net
GNU Affero General Public License v3.0
765 stars 258 forks source link

[Feature]: Enable setting of HTML attributes via markdown and markdownToHtml() #4840

Open Baaaaaz opened 3 weeks ago

Baaaaaz commented 3 weeks ago

Describe the Problem

When using markdownToHtml() function I'm not able to set ids, classes, or other attributes in markdown script to be incorporated into the processed HTML output.

The Solution you'd like

Add the extension https://github.com/vsch/flexmark-java/tree/master/flexmark-ext-attributes to the to markdownToHtml() function and enable all its goodness.

Alternatives that you've considered.

Writing HTML in the markdown script in order to set the attributes, which defeats the purpose of using markdown in the first place.

Additional Context

No response

bubblobill commented 3 weeks ago

I'm not personally a fan of markdown so I'm not aware of what's available. Bearing that in mind, constructing feature sets from various libraries ad-hoc seems less useful than plumbing in a library that is fully featured and copes with different dialects. Are there any off-the-shelf options that could be used without too much pain?

Baaaaaz commented 3 weeks ago

Not sure about the ad-hoc bit in this case! As doesn't MapTool already use the flexmark library and some of its extensions already in markdownToHtml? i.e. https://github.com/RPTools/maptool/blob/release-1.14/src/main/java/net/rptools/maptool/client/functions/MarkDownFunctions.java