@ -43,10 +43,10 @@ were limited to `m.text`, `m.emote`, `m.notice`, and
Clients should limit the HTML they render to avoid Cross-Site Scripting,
Clients should limit the HTML they render to avoid Cross-Site Scripting,
HTML injection, and similar attacks. The strongly suggested set of HTML
HTML injection, and similar attacks. The strongly suggested set of HTML
tags to permit, denying the use and rendering of anything else, is:
tags to permit, denying the use and rendering of anything else, is:
`font` , `del` , `h1` , `h2` , `h3` , `h4` , `h5` , `h6` , `blockquote` , `p` ,
`del` , `h1` , `h2` , `h3` , `h4` , `h5` , `h6` , `blockquote` , `p` , `a` , `ul` ,
`a` , `ul` , `ol` , `sup` , `sub` , `li` , `b` , `i` , `u` , `strong` , `em` ,
`ol` , `sup` , `sub` , `li` , `b` , `i` , `u` , `strong` , `em` , `s` , `code` ,
`s` , `code` , `hr` , `br` , `div` , `table` , `thead` , `tbody` , `tr` ,
`hr` , `br` , `div` , `table` , `thead` , `tbody` , `tr` , `th` , `td` ,
`th` , `td` , `caption` , `pre` , `span` , `img` , `details` , `summary` .
`caption` , `pre` , `span` , `img` , `details` , `summary` .
{{% boxes/note %}}
{{% boxes/note %}}
{{% added-in v="1.10" %}}
{{% added-in v="1.10" %}}
@ -55,6 +55,14 @@ requiring a [Spec Change Proposal](/proposals) when they are deprecated in the
[WHATWG HTML Living Standard ](https://html.spec.whatwg.org/multipage/ ).
[WHATWG HTML Living Standard ](https://html.spec.whatwg.org/multipage/ ).
{{% /boxes/note %}}
{{% /boxes/note %}}
{{% boxes/note %}}
{{% changed-in v="1.10" %}}
In previous versions of the specification, the `font` tag was suggested with the
`data-mx-bg-color` , `data-mx-color` and `color` attributes. This tag is now
deprecated in favor of the `span` tag with the `data-mx-bg-color` and
`data-mx-color` attributes in new messages.
{{% /boxes/note %}}
Not all attributes on those tags should be permitted as they may be
Not all attributes on those tags should be permitted as they may be
avenues for other disruption attempts, such as adding `onclick` handlers
avenues for other disruption attempts, such as adding `onclick` handlers
or excessively large text. Clients should only permit the attributes
or excessively large text. Clients should only permit the attributes
@ -65,7 +73,6 @@ the tag.
| Tag | Permitted Attributes |
| Tag | Permitted Attributes |
|--------|--------------------------------------------------------------------------------------------------------------------------------------------|
|--------|--------------------------------------------------------------------------------------------------------------------------------------------|
| `font` | `data-mx-bg-color` , `data-mx-color` , `color` |
| `span` | `data-mx-bg-color` , `data-mx-color` , `data-mx-spoiler` (see [spoiler messages ](#spoiler-messages )) |
| `span` | `data-mx-bg-color` , `data-mx-color` , `data-mx-spoiler` (see [spoiler messages ](#spoiler-messages )) |
| `a` | `name` , `target` , `href` (provided the value is not relative and has a scheme matching one of: `https` , `http` , `ftp` , `mailto` , `magnet` ) |
| `a` | `name` , `target` , `href` (provided the value is not relative and has a scheme matching one of: `https` , `http` , `ftp` , `mailto` , `magnet` ) |
| `img` | `width` , `height` , `alt` , `title` , `src` (provided it is a [Matrix Content (`mxc://`) URI ](#matrix-content-mxc-uris )) |
| `img` | `width` , `height` , `alt` , `title` , `src` (provided it is a [Matrix Content (`mxc://`) URI ](#matrix-content-mxc-uris )) |