refactor: use ## for intra doc

main
Xubai Wang 2022-02-18 03:26:38 +08:00
parent 89f5951f2d
commit 9550d1c92e
1 changed files with 7 additions and 4 deletions

View File

@ -47,11 +47,14 @@ def possibleNameToLink (s : String) : HtmlM (Option String) := do
| _ => pure none | _ => pure none
def extendRelativeLink (s : String) : HtmlM String := do def extendRelativeLink (s : String) : HtmlM String := do
-- for relative doc links -- for intra doc links
if s.startsWith "#" then if s.startsWith "##" then
if let some link ← possibleNameToLink (s.drop 1) then if let some link ← possibleNameToLink (s.drop 2) then
pure link pure link
else else
panic! s!"Cannot find {s.drop 2}, only full name and abbrev in current module is supported"
-- for id
else if s.startsWith "#" then
pure s pure s
-- for absolute and relative urls -- for absolute and relative urls
else if s.startsWith "http" then else if s.startsWith "http" then