fix: clear all tags from the editor; escape captions in feed HTML (v2.14.1)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
PhilandClaude Opus 5.5 committed 2026-11-10 15:37:35 -07:00
1 parent 058b1959f9
commit 7e2cdef150
12 files changed
+163 -23

No files matched your search

+3 -2
View File
@@ -16,6 +16,7 @@ Standards:
"""
# Standard library imports
from html import escape
from datetime import datetime, timezone
from typing import Optional
import xml.etree.ElementTree as ET
@@ -199,8 +200,8 @@ def generate_atom_streaming(
html_content += '<div class="media">'
for item in note.media:
media_url = f"{site_url}/media/{item['path']}"
caption = item.get('caption', '')
html_content += f'<img src="{media_url}" alt="{caption}" />'
caption = escape(item.get('caption') or '', quote=True) # v2.14.1
html_content += f'<img src="{escape(media_url, quote=True)}" alt="{caption}" />'
html_content += '</div>'
# Add text content below media
+3 -2
View File
@@ -16,6 +16,7 @@ Standards:
"""
# Standard library imports
from html import escape
from datetime import datetime, timezone
from typing import Optional, Dict, Any
import json
@@ -247,8 +248,8 @@ def _build_item_object(site_url: str, note: Note) -> Dict[str, Any]:
content_html += '<div class="media">'
for media_item in note.media:
media_url = f"{site_url}/media/{media_item['path']}"
caption = media_item.get('caption', '')
content_html += f'<img src="{media_url}" alt="{caption}" />'
caption = escape(media_item.get('caption') or '', quote=True) # v2.14.1
content_html += f'<img src="{escape(media_url, quote=True)}" alt="{caption}" />'
content_html += '</div>'
# Add text content below media
+5 -4
View File
@@ -20,6 +20,7 @@ Standards:
"""
# Standard library imports
from html import escape
from datetime import datetime, timezone
from typing import Optional
@@ -127,8 +128,8 @@ def generate_rss(
html_content += '<div class="media">'
for item in note.media:
media_url = f"{site_url}/media/{item['path']}"
caption = item.get('caption', '')
html_content += f'<img src="{media_url}" alt="{caption}" />'
caption = escape(item.get('caption') or '', quote=True) # v2.14.1
html_content += f'<img src="{escape(media_url, quote=True)}" alt="{caption}" />'
html_content += '</div>'
# Add text content below media
@@ -254,8 +255,8 @@ def generate_rss_streaming(
html_content += '<div class="media">'
for item in note.media:
media_url = f"{site_url}/media/{item['path']}"
caption = item.get('caption', '')
html_content += f'<img src="{media_url}" alt="{caption}" />'
caption = escape(item.get('caption') or '', quote=True) # v2.14.1
html_content += f'<img src="{escape(media_url, quote=True)}" alt="{caption}" />'
html_content += '</div>'
# Add text content below media