mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-09 00:12:21 +02:00
Squash Odysseus development history
This commit is contained in:
+2
-1
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user