You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been reading through the docs and codebase and I'm stilling having trouble understanding how the flexmark-ext-xwiki-macros extension can be used to render custom output.
What I'm looking to do is create some special macros for rendering pre-made HTML snippets, but I do not want to allow raw HTML in the input.
When I enable the plugin and set the MacroExtension.ENABLE_RENDERING to true, my input renders as:
{{alert}}
Hello <strong>world</strong>
{{/alert}}
When I set MacroExtension.ENABLE_RENDERING to false, the content is left out of the rendered output.
What I'd like to be able to do is a few things:
Decide on a case-by-case bases whether output should be rendered. There may be some cases where I do not want the child content rendered from Commonmark.
Replace the {{alert}} and {{/alert}} placeholders with the correct text.
In looking at the MacroNodeRenderer I see why it's rendering that way, but I'm not seeing how to overwrite the behavior.
I could call setOpeningMarker() and setClosingMarker() to change the markers and then setName() to change the contents to the HTML I want, but that doesn't seem right.
And how I would I choose to skip outputting and just capture the data if I needed to?
I'm obviously missing something basic.
Can anyone help me?
Thanks!
-Dan
The text was updated successfully, but these errors were encountered:
After spending more time looking through the Flexmark code, I'm guessing the flexmark-ext-xwiki-macros extension isn't designed to do anything other than either strip the instructions out or to leave them as-is.
I'm thinking I'll need to fork the extension to do what I was hoping to do.
I've been reading through the docs and codebase and I'm stilling having trouble understanding how the flexmark-ext-xwiki-macros extension can be used to render custom output.
What I'm looking to do is create some special macros for rendering pre-made HTML snippets, but I do not want to allow raw HTML in the input.
For example:
I'd want that to generate something like:
When I enable the plugin and set the
MacroExtension.ENABLE_RENDERING
totrue
, my input renders as:When I set
MacroExtension.ENABLE_RENDERING
tofalse
, the content is left out of the rendered output.What I'd like to be able to do is a few things:
{{alert}}
and{{/alert}}
placeholders with the correct text.In looking at the
MacroNodeRenderer
I see why it's rendering that way, but I'm not seeing how to overwrite the behavior.I could call
setOpeningMarker()
andsetClosingMarker()
to change the markers and thensetName()
to change the contents to the HTML I want, but that doesn't seem right.And how I would I choose to skip outputting and just capture the data if I needed to?
I'm obviously missing something basic.
Can anyone help me?
Thanks!
-Dan
The text was updated successfully, but these errors were encountered: