fix: remove intra link in code block
parent
11bb2af57a
commit
0b9a9f0bdc
|
@ -33,8 +33,10 @@ def textToIdAttribute (s : String) : String :=
|
|||
def possibleNameToLink (s : String) : HtmlM (Option String) := do
|
||||
let res ← getResult
|
||||
let name := s.splitOn "." |>.foldl (λ acc part => Name.mkStr acc part) Name.anonymous
|
||||
-- with exactly the same name
|
||||
if res.name2ModIdx.contains name then
|
||||
declNameToLink name
|
||||
-- find similar name in the same module
|
||||
else
|
||||
match (← getCurrentName) with
|
||||
| some currentName =>
|
||||
|
@ -93,7 +95,7 @@ partial def modifyElement (element : Element) (linkCode : Bool := true) : HtmlM
|
|||
| none => pure attrs
|
||||
pure ⟨ name, newAttrs, contents⟩
|
||||
-- auto link for inline <code></code>
|
||||
else if name = "code" then
|
||||
else if name = "code" ∧ linkCode then
|
||||
let mut newContents := #[]
|
||||
for c in contents do
|
||||
match c with
|
||||
|
|
Loading…
Reference in New Issue