summaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/deviantart.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2024-12-22 05:45:18 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2024-12-22 05:45:18 -0500
commitbb8260277ab7483652c6c1526a15d62da92acc96 (patch)
tree02959c9d5aceb66f4429e0be1bc927921e01bbdc /gallery_dl/extractor/deviantart.py
parentf6877087773089220d68288d055276fca6c556d4 (diff)
New upstream version 1.28.2.upstream/1.28.2
Diffstat (limited to 'gallery_dl/extractor/deviantart.py')
-rw-r--r--gallery_dl/extractor/deviantart.py26
1 files changed, 25 insertions, 1 deletions
diff --git a/gallery_dl/extractor/deviantart.py b/gallery_dl/extractor/deviantart.py
index ea3f13d..69934b4 100644
--- a/gallery_dl/extractor/deviantart.py
+++ b/gallery_dl/extractor/deviantart.py
@@ -451,6 +451,26 @@ class DeviantartExtractor(Extractor):
elif type == "text":
self._tiptap_process_text(html, content)
+ elif type == "heading":
+ attrs = content["attrs"]
+ level = str(attrs.get("level") or "3")
+
+ html.append("<h")
+ html.append(level)
+ html.append(' style="text-align:')
+ html.append(attrs.get("textAlign") or "left")
+ html.append('">')
+ html.append('<span style="margin-inline-start:0px">')
+
+ children = content.get("content")
+ if children:
+ for block in children:
+ self._tiptap_process_content(html, block)
+
+ html.append("</span></h")
+ html.append(level)
+ html.append(">")
+
elif type == "hardBreak":
html.append("<br/><br/>")
@@ -478,8 +498,9 @@ class DeviantartExtractor(Extractor):
for mark in marks:
type = mark["type"]
if type == "link":
+ attrs = mark.get("attrs") or {}
html.append('<a href="')
- html.append(text.escape(mark["attrs"]["href"]))
+ html.append(text.escape(attrs.get("href") or ""))
html.append('" rel="noopener noreferrer nofollow ugc">')
close.append("</a>")
elif type == "bold":
@@ -491,6 +512,9 @@ class DeviantartExtractor(Extractor):
elif type == "underline":
html.append("<u>")
close.append("</u>")
+ elif type == "strike":
+ html.append("<s>")
+ close.append("</s>")
elif type == "textStyle" and len(mark) <= 1:
pass
else: