Squash Odysseus development history

This commit is contained in:
pewdiepie-archdaemon
2026-09-11 06:04:19 +00:00
parent c9dd68d890
commit 84aa9a91de
871 changed files with 265870 additions and 27854 deletions
+2 -1
View File
@@ -29,7 +29,7 @@ _FRONT_MATTER_RE = re.compile(
# Freeform annotation bullet — mirrors the JS regex in static/js/document.js.
# Coords are page percentages (0–100); kind/lh are optional for backward compat.
_ANNOTATION_RE = re.compile(
r'^[ \t]*-\s+(?P<value>.*?)\s*<!--\s*annotation\s+id=(?P<id>[\w-]+)\s+page=(?P<page>\d+)\s+x=(?P<x>[\d.]+)\s+y=(?P<y>[\d.]+)\s+w=(?P<w>[\d.]+)\s+h=(?P<h>[\d.]+)(?:\s+kind=(?P<kind>\w+))?(?:\s+lh=(?P<lh>[\d.]+))?\s*-->[ \t]*$',
r'^[ \t]*-\s+(?P<value>.*?)\s*<!--\s*annotation\s+id=(?P<id>[\w-]+)\s+page=(?P<page>\d+)\s+x=(?P<x>[\d.]+)\s+y=(?P<y>[\d.]+)\s+w=(?P<w>[\d.]+)\s+h=(?P<h>[\d.]+)(?:\s+kind=(?P<kind>\w+))?(?:\s+lh=(?P<lh>[\d.]+))?(?:\s+fs=(?P<fs>[\d.]+))?\s*-->[ \t]*$',
re.MULTILINE,
)
@@ -80,6 +80,7 @@ def parse_markdown_annotations(content: str) -> list[dict]:
"h": float(m.group("h")),
"kind": m.group("kind") or "text",
"line_height": float(m.group("lh")) if m.group("lh") else 1.3,
"font_size": float(m.group("fs")) if m.group("fs") else 11.0,
"value": value,
})
except (ValueError, TypeError) as e: