Compare commits
No commits in common. "05ca46ffef310f7e98d0a5a9c4973c052cc7bd62" and "c0f8f1da3888c8235c403b6912d1ac3264e86df6" have entirely different histories.
05ca46ffef
...
c0f8f1da38
2 changed files with 2 additions and 3 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -6,7 +6,6 @@ meme.jpg
|
|||
toots.db
|
||||
toots.db-journal
|
||||
toots.db-wal
|
||||
.mypy_cache/
|
||||
__pycache__/
|
||||
__pypackages__/
|
||||
.vscode/
|
||||
|
|
|
@ -80,10 +80,10 @@ def extract_toot(toot):
|
|||
toot = html.unescape(toot) # convert HTML escape codes to text
|
||||
soup = BeautifulSoup(toot, "html.parser")
|
||||
for lb in soup.select("br"): # replace <br> with linebreak
|
||||
lb.append('\n')
|
||||
lb.name = "\n"
|
||||
|
||||
for p in soup.select("p"): # ditto for <p>
|
||||
p.append('\n\n')
|
||||
p.name = "\n"
|
||||
|
||||
for ht in soup.select("a.hashtag"): # convert hashtags from links to text
|
||||
ht.unwrap()
|
||||
|
|
Loading…
Reference in a new issue