diff --git a/src/dragonglass/mparse.py b/src/dragonglass/mparse.py index 546e9a1..63da1d7 100644 --- a/src/dragonglass/mparse.py +++ b/src/dragonglass/mparse.py @@ -152,6 +152,7 @@ class ObsidianImages(Extension): int: The image width in pixels, or -1 if not specified. int: The image height in pixels, or -1 if not specified. """ + s = s.replace(r'\|', '|') # handle case where we're inside tables m = self.DIMS.match(s) if m: width = int(m.group(2)) @@ -248,11 +249,12 @@ class ObsidianLinks(Extension): return 'invalid-reference' def _parse_reference(self, contents: str) -> tuple[str | None, str]: + contents = contents.replace(r'\|','|') # handle case where we're inside tables text = None t = contents.split('|') if len(t) > 1: text = t[1] - contents = t[0] + contents = t[0].rstrip('\\') assert self._context.src_index is not None node, _ = self._context.src_index.lookup(contents)