Skip to content

Commit

Permalink
feature: Attachments linked with a "./" prefix are rendered relative …
Browse files Browse the repository at this point in the history
…to the page.

This was brought up in #163.
  • Loading branch information
redimp committed Nov 16, 2024
1 parent e0d6410 commit 3170c64
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions otterwiki/renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@ def parse_std_link(self, m, state):
link = mistune.inline_parser.ESCAPE_CHAR.sub(r'\1', m.group(2))
if link.startswith('<') and link.endswith('>'):
link = link[1:-1]
elif link.startswith("./"):
if self.env.get("PAGE_URL", None) is not None:
link = self.env["PAGE_URL"]+"/"+link

title = m.group(3)
if title:
Expand Down

0 comments on commit 3170c64

Please sign in to comment.