Merge remote-tracking branch 'origin/main' into feature/references

This commit is contained in:
Johanna Riedel
2024-12-08 12:12:06 +01:00
3 changed files with 21 additions and 10 deletions
+6 -5
View File
@@ -18,7 +18,7 @@ class FiftyOhmHtmlRenderer(HtmlRenderer):
margin_id = 0
def __init__(self):
super().__init__(Dash, BlockComment, SpanComment, Quote, Underline, Tag, HalfwidthSpaces, NonbreakingSpaces, NonbreakingSpacesDots, References)
super().__init__(Dash, BlockComment, SpanComment, Quote, Underline, Tag, HalfwidthSpaces, NonbreakingSpaces, NonbreakingSpacesDots, HalfwidthSpaces, NonbreakingSpaces, NonbreakingSpacesDots, References)
def render_dash(self, token):
return " – "
@@ -97,7 +97,8 @@ class FiftyOhmHtmlRenderer(HtmlRenderer):
return f"{token.first} {token.second}"
def render_nonbreaking_spaces_dots(self, token):
return f" {token.first} "
def render_references(self, token, dest_id=0, chap_url="DeineMama.html"):
return f"<a href=&#34;{chap_url}#ref_{token.first}&#34; onclick=&#34;highlightRef(&#39;{token.first}&#39;);&#34;>{dest_id}</a>"
lookup = {
"" : "",
" " : "&#160;"
}
return f"{lookup[token.first]}{token.second}{lookup[token.third]}"