Skip to content

Conversation

@yhatt
Copy link
Member

@yhatt yhatt commented Sep 8, 2024

Resolves #301, #368.

Marp Core now becomes to allow a lot of HTML elements and attributes by default, that are considered as safe. The allowlist covers some mentioned elements and attributes in the feedback thread https://github.com/orgs/marp-team/discussions/501.

href, src, and similar attributes include URL schema checking. By default, non-http and https schemes are always sanitized. If the attribute may allow an image, data:image/* is also allowed.

Elements and attributes that have too much power, such as <script>, <link> element, on***, and style attribute, are still not allowed by default. The developer can enable them through html: true constructor option as before.

Tip

To get back into the previous allowlist compliant with Marp Core v3, set html constructor option as html: { br: [] }. That only allows <br> tag.

@yhatt yhatt merged commit 857035c into main Sep 8, 2024
@yhatt yhatt deleted the relax-html-allow-list branch September 8, 2024 13:21
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.

Relax HTML allowlist

2 participants