re-add rss feeds
This commit is contained in:
@@ -6,7 +6,7 @@ from pygments.lexers import get_lexer_by_name
|
||||
from pygments.util import ClassNotFound as PygmentsClassNotFound
|
||||
import re
|
||||
|
||||
BABYCODE_VERSION = 11
|
||||
BABYCODE_VERSION = 13
|
||||
|
||||
|
||||
class BabycodeError(Exception):
|
||||
@@ -406,6 +406,13 @@ def tag_quote(children, attr):
|
||||
|
||||
return f'<fieldset class="plank minimal no-shadow secondary-bg"><legend>{quotee}</legend><blockquote>{children}</blockquote></fieldset>'
|
||||
|
||||
def tag_quote_rss(children, attr):
|
||||
if attr:
|
||||
quotee = f'Quoting: {attr.strip()}'
|
||||
return f'<figure><blockquote>{children}</blockquote><figcaption>{quotee}</figcaption></figure>'
|
||||
else:
|
||||
return f'<blockquote>{children}</blockquote>'
|
||||
|
||||
TAGS = {
|
||||
"b": lambda children, attr: f"<strong>{children}</strong>",
|
||||
"i": lambda children, attr: f"<em>{children}</em>",
|
||||
@@ -462,6 +469,7 @@ RSS_TAGS = {
|
||||
'url': tag_url_rss,
|
||||
'spoiler': lambda children, attr: f'<details><summary>{attr or "Spoiler"} (click to reveal)</summary>{children}</details>',
|
||||
'code': tag_code_rss,
|
||||
'quote': tag_quote_rss,
|
||||
|
||||
'big': lambda children, attr: f'<span style="font-size: 1.2em">{children}</span>',
|
||||
'small': lambda children, attr: f'<small>{children}</small>'
|
||||
|
||||
Reference in New Issue
Block a user