]> cat aescling's git repositories - mastodon.git/commit
Add backend support for `<spoiler-text>`
authorkibigo! <go@kibi.family>
Fri, 11 Nov 2022 04:51:51 +0000 (20:51 -0800)
committerkibigo! <go@kibi.family>
Sun, 13 Nov 2022 04:50:44 +0000 (20:50 -0800)
commit578e1e58c23194ce9ed66ac3fd8e027244f84e2e
tree66b4514bc6cd8fd1a7f177204eef9214ed5eb1eb
parentd892dd8a268dbcd312deb6d06f92d863fd06e0f9
Add backend support for `<spoiler-text>`

This produces a `<span>` with:

- A `property` attribute of `"tag:ns.1024.gdn,2022-11:spoiler_text"`.

- A `content` attribute of the original text contents of the
  `<spoiler-text>` element.

- Text contents which replace ASCII basic latin characters with their
  ROT13 equivalents and other alphabetic characters with REPLACEMENT
  CHARACTER. (The intent is that ROT13 gives a reasonable fallback for
  unsupporting servers for Latin‐script posts.)

`property` and `content` are RDFa attributes and don’t have any notable
security implications. They are disallowed on local posts because users
should just use `<spoiler-text>` directly instead.

Getting this to render nicely in the frontend is future work :) .
app/lib/advanced_text_formatter.rb
lib/sanitize_ext/sanitize_config.rb