~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
3 2

[PATCH core.sr.ht] Remove extra # from toc generation

Details
Message ID
<20200915160737.2058-1-gildarts@orbital.rocks>
DKIM signature
fail
Download raw message
Patch: +2 -1 DKIM signature: fail
Sorry for the confusion on my end with the previous patches.

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

diff --git a/srht/markdown.py b/srht/markdown.py
index 55c0755..ba0ff28 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 = 10
SRHT_MARKDOWN_VERSION = 11

class PlainLink(SpanToken):
    """
@@ -216,6 +216,7 @@ def extract_toc(markup):
            continue
        while cur.level >= level:
            cur = cur.parent
        el.a.extract()
        heading = Heading(
            level=level, name=el.text,
            id=el.attrs.get("id"),
-- 
2.25.1
Details
Message ID
<C5O2NJAHDTGZ.1Y02VX2JYHMGU@homura>
In-Reply-To
<20200915160737.2058-1-gildarts@orbital.rocks> (view parent)
DKIM signature
pass
Download raw message
Does this extract all of the links or just the first one?
Details
Message ID
<a3b5e488-0e21-9d72-4428-88c29a15460e@orbital.rocks>
In-Reply-To
<C5O2NJAHDTGZ.1Y02VX2JYHMGU@homura> (view parent)
DKIM signature
fail
Download raw message
DKIM signature: fail
On 9/15/2020 12:09 PM, Drew DeVault wrote:
> Does this extract all of the links or just the first one?
> 

Just the first one from my testing.

```
 >>> soup = BeautifulSoup("<h1><a>#</a><a>test</a></h1>", "html5lib")
 >>> h_tag = soup.h1.extract()
 >>> print(h_tag)
<h1><a>#</a><a>test</a></h1>
 >>> h_tag.a.extract()
<a>#</a>
 >>> print(h_tag)
<h1><a>test</a></h1>
```

-gildarts
Details
Message ID
<C5O2PYV7YH98.3SV7K7OWX307G@homura>
In-Reply-To
<20200915160737.2058-1-gildarts@orbital.rocks> (view parent)
DKIM signature
pass
Download raw message
Thanks!

To git@git.sr.ht:~sircmpwn/core.sr.ht
   d67a56a..22dca28  master -> master
Review patch Export thread (mbox)