matrix-react-sdk
matrix-react-sdk copied to clipboard
Use span and style instead of font (W3C compliance)
Currently, the rainbow command output a series of <font> elements. This HTML element has been depreciated in HTML4.01, and is obsolete in HTML5. This PR changes this to <span style="color:the-colour"> instead.
I don't know if it's an enhancement (it's very small) or a fix (the current code still works, it's just W3C-invalid). Could someone help me on that? Thanks.
Signed-off-by: Lara Dufour [email protected]
This PR currently has no changelog labels, so will not be included in changelogs.
A reviewer can add one of: T-Deprecation, T-Enhancement, T-Defect, T-Task to indicate what type of change this is, or add Type: [enhancement/defect/task] to the description and I'll add them for you.
This needs changing at the spec level first.
https://spec.matrix.org/v1.2/client-server-api/#mroommessage-msgtypes does not allow style on span tags.
This also does not work because we apply the spec as a sanitizer for allowed html tags & attributes.

This needs changing at the spec level first. https://spec.matrix.org/v1.2/client-server-api/#mroommessage-msgtypes does not allow
styleonspantags.
Oh. I didn't know that.
After reading the specs, data-mx-color is permitted. Does this attribute give colour to the element it's on? I did only change the code and fire yarn test, because I don't know how to deploy a complete Matrix + Element environment in order to test in conditions.
because I don't know how to deploy a complete Matrix + Element environment in order to test in conditions.
You can use the Netlify deployment made by this PR

Or follow https://github.com/vector-im/element-web/#setting-up-a-dev-environment
After reading the specs, data-mx-color is permitted. Does this attribute give colour to the element it's on?
In theory, it is worth testing. But also the spec says that font+color is fine so there is no reason to change it before the spec deprecates that to follow the HTML spec.
I suggest opening an issue in https://github.com/matrix-org/matrix-spec recommending deprecating the font tag in favour of span, this PR is neither a defect nor an enhancement whilst font is not deprecated in the Matrix spec.
Yes, I'll do that, thank you @t3chguy !
@Lamecarlate as mentioned in previous comments, this PR would need an MSC. You can read here about the process. I will close this PR until the MSC is there. Feel free to add another comment here if you want it reopened. Thank you also for your efforts so far.