Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add markdown support for consent message #2100

Merged
merged 2 commits into from
Dec 5, 2023
Merged

Add markdown support for consent message #2100

merged 2 commits into from
Dec 5, 2023

Conversation

nmattia
Copy link
Collaborator

@nmattia nmattia commented Dec 4, 2023

This adds support for rendering consent messages as markdown.

We use marked for rendering the markdown to HTML, and then sanitize the HTML with DOMPurify. The consent message is rendered async and the original message (raw markdown) is shown until the markdown was rendered (in practice, instantaneous).


🟡 Some screens were changed

This adds support for rendering consent messages as markdown.

We use [`marked`](https://www.npmjs.com/package/marked) for rendering
the markdown to HTML, and then sanitize the HTML with
[`DOMPurify`](https://www.npmjs.com/package/dompurify). The consent
message is rendered async and the original message (raw markdown) is
shown until the markdown was rendered (in practice, instantaneous).
Copy link
Member

@peterpeterparker peterpeterparker left a comment

Choose a reason for hiding this comment

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

LGTM, thx

package.json Show resolved Hide resolved
@nmattia nmattia enabled auto-merge December 5, 2023 16:38
@nmattia nmattia added this pull request to the merge queue Dec 5, 2023
Merged via the queue into main with commit f7eacbc Dec 5, 2023
53 checks passed
@nmattia nmattia deleted the nm-md-consent branch December 5, 2023 16:50
nmattia added a commit that referenced this pull request Dec 8, 2023
* Add markdown support for consent message

This adds support for rendering consent messages as markdown.

We use [`marked`](https://www.npmjs.com/package/marked) for rendering
the markdown to HTML, and then sanitize the HTML with
[`DOMPurify`](https://www.npmjs.com/package/dompurify). The consent
message is rendered async and the original message (raw markdown) is
shown until the markdown was rendered (in practice, instantaneous).

* Use NNS dapp markdown helper
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