This thread contains a patchset. You're looking at the original emails,
but you may wish to use the patch review UI.
Review patch
1
[PATCH v2] Add strikethrough support to SrhtRenderer
---
This patch adds del to the html sanitize
whitelist, allowing strikethroughs.
srht/markdown.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/srht/markdown.py b/srht/markdown.py
index 5005542..4b8431b 100644
--- a/srht/markdown.py
+++ b/srht/markdown.py
@@ -12,7 +12,7 @@ import mistletoe as m
from mistletoe.span_token import SpanToken, RawText
import re
-SRHT_MARKDOWN_VERSION = 14
+SRHT_MARKDOWN_VERSION = 15
class PlainLink(SpanToken):
"""
@@ -182,6 +182,7 @@ _sanitizer = bleach.sanitizer.Cleaner(
"h1", "h2", "h3", "h4", "h5", "h6",
"details", "summary",
"abbr", "dfn",
+ "del",
],
attributes={**bleach.sanitizer.ALLOWED_ATTRIBUTES, **_sanitizer_attrs},
protocols=[
--
2.36.1
On 7/22/2022 1:04 PM, jack gleeson wrote:
> ---
> This patch adds del to the html sanitize
> whitelist, allowing strikethroughs.
> srht/markdown.py | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/srht/markdown.py b/srht/markdown.py
> index 5005542..4b8431b 100644
> --- a/srht/markdown.py
> +++ b/srht/markdown.py
> @@ -12,7 +12,7 @@ import mistletoe as m
> from mistletoe.span_token import SpanToken, RawText
> import re
>
> -SRHT_MARKDOWN_VERSION = 14
> +SRHT_MARKDOWN_VERSION = 15
>
> class PlainLink(SpanToken):
> """
> @@ -182,6 +182,7 @@ _sanitizer = bleach.sanitizer.Cleaner(
> "h1", "h2", "h3", "h4", "h5", "h6",
> "details", "summary",
> "abbr", "dfn",
> + "del",
> ],
> attributes={**bleach.sanitizer.ALLOWED_ATTRIBUTES, **_sanitizer_attrs},
> protocols=[
LGTM. Here's to hoping CommonMark and Mistletoe get a better solution
eventually.