Skip to content
This repository was archived by the owner on Oct 19, 2024. It is now read-only.

Commit 510cc4c

Browse files
committed
markdown guide: Add more details about HTML
1 parent 822a8ce commit 510cc4c

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

docs/markdown.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,27 @@ As the full GFM spec is too large to read comfortably and [GitHub's formatting g
1111
The displayed features may not reflect the actual style used on Modrinth.
1212
:::
1313

14+
HTML also works in all Markdown fields. However, use of HTML tends to override default element styles used on Modrinth. For the sake of consistency, we therefore advise against using HTML elements, except when there is no Markdown equivalent (e.g., spoilers and YouTube iframes).
15+
16+
You can view the spoiler below to see more specifics on how our HTML rendering works.
17+
18+
<details><summary>Supported HTML features</summary>
19+
20+
A broad subset of HTML is supported. The [default XSS whitelist](https://github.com/leizongmin/js-xss/blob/master/dist/xss.js#L12) is used, and the following tags are also supported:
21+
- `kbd`
22+
- `iframe` (only from YouTube or Discord)
23+
- `input`
24+
- `map`
25+
- `picture`
26+
- `source`
27+
28+
Additionally, certain elements also support being styled with the following CSS:
29+
- `float`
30+
- `image-rendering` (only the `pixelated` option, otherwise `auto` is used)
31+
- `text-align`
32+
33+
</details>
34+
1435
## Basic formatting
1536

1637
<Tabs>
@@ -116,6 +137,10 @@ https://modrinth.com
116137
</TabItem>
117138
</Tabs>
118139

140+
:::note
141+
All links have the following `rel` set by default: `noopener nofollow ugc`. If you don't know what this means, you probably don't need to worry about it.
142+
:::
143+
119144
## Images
120145

121146
<Tabs>

0 commit comments

Comments
 (0)