~sircmpwn/sr.ht-dev

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 core.sr.ht] Add anchor tag to bleach sanitizer whitelist

Details
Message ID
<20201205020304.30947-1-sourcehut.trs-80@isnotmyreal.name>
DKIM signature
pass
Download raw message
Patch: +2 -0
---
Hello,

This is my first attempt at the patch Drew requested at the bottom of
this[0] thread.

I am pretty sure that this is not a complete solution.  I was looking
at the render_link functions for instance, but got a little lost at
that point to be perfectly honest.  My Python is only so-so.

But I am trying.  Any help would be greatly appreciated.  I am willing
to throw somebody some beer money, even.

Cheers,
TRS-80

[0] https://lists.sr.ht/~sircmpwn/sr.ht-discuss/%3Cfe7aa296-9c90-463d-b4e6-50eeb7e57428%40localhost%3E

 srht/markdown.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/srht/markdown.py b/srht/markdown.py
index 8929803..1b97410 100644
--- a/srht/markdown.py
+++ b/srht/markdown.py
@@ -139,6 +139,7 @@ def _wildcard_filter(tag, name, value):
    return name in ["style", "class", "colspan", "rowspan"]

_sanitizer_attrs = {
    "a": ["id"],
    "h1": ["id"],
    "h2": ["id"],
    "h3": ["id"],
@@ -159,6 +160,7 @@ _sanitizer = bleach.sanitizer.Cleaner(
        "img",
        "q",
        "h1", "h2", "h3", "h4", "h5", "h6",
        "a",
    ],
    attributes=_sanitizer_attrs,
    protocols=[
-- 
2.29.2

[core.sr.ht/patches] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<C7KHG3B69XD3.3D8K9YLCDZVLC@cirno>
In-Reply-To
<20201205020304.30947-1-sourcehut.trs-80@isnotmyreal.name> (view parent)
DKIM signature
missing
Download raw message
core.sr.ht/patches: SUCCESS in 2m40s

[Add anchor tag to bleach sanitizer whitelist][0] from [TRS-80][1]

[0]: https://lists.sr.ht/~sircmpwn/sr.ht-dev/patches/15483
[1]: sourcehut.trs-80@isnotmyreal.name

✓ #359210 SUCCESS core.sr.ht/patches/alpine.yml    https://builds.sr.ht/~sircmpwn/job/359210
✓ #359212 SUCCESS core.sr.ht/patches/debian.yml    https://builds.sr.ht/~sircmpwn/job/359212
✓ #359211 SUCCESS core.sr.ht/patches/archlinux.yml https://builds.sr.ht/~sircmpwn/job/359211
Reply to thread Export thread (mbox)