Skip to content

JSPWIKI-1296 see jira for details - #528

Open
spyhunter99 wants to merge 2 commits into
masterfrom
bug/JSPWIKI.1296
Open

spyhunter99 wants to merge 2 commits into
masterfrom
bug/JSPWIKI.1296

Conversation

@spyhunter99

Copy link
Copy Markdown
Contributor

No description provided.

* @param attributes the final attribute set of the node, mutated in place
*/
static void sanitize(final Node node, final AttributablePart part, final MutableAttributes attributes) {
for (final String name : new ArrayList<>(attributes.keySet())) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's a property to enable unsafe html that would've to be checked here, but otherwise than that it's a lgtm for me

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i looked into this, not clear how to get access to the wiki properties, engine or context from this class. any ideas?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In MarkdownForJSPWikiExtension f.ex., Context is passed through the constructor, which is passed on MarkdownDocument#options, which comes from MarkdownRenderer, from both constructor and getString method. The create constructor for the extensions seems more a convention inside Flexmark than anything else, it works fine if you pass the Context there (not sure if explaining myself clearly.. a bit late here)

@juanpablo-santos juanpablo-santos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

*/
@Override
public void rendererOptions(final MutableDataHolder options) {
escapeHtml = HtmlRenderer.ESCAPE_HTML.get(options);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not what I had in mind, but definitely better!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants