Browse Source

Look for tags inside HTML comments

Enables the idiom

  <!--
  ```agda
  _ = X
  ```
  -->

for tricking the filter into picking the right name.
master
Amélia Liao 2 years ago
parent
commit
1627cb7adc
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      src/Main.hs

+ 4
- 1
src/Main.hs View File

@ -62,9 +62,12 @@ parseSymbolRefs :: [Block] -> HashMap Text Reference
parseSymbolRefs = go mempty . concat . mapMaybe getHTML where
getHTML :: Block -> Maybe ([Tag Text])
getHTML (RawBlock (Format x) xs)
| x == "html" = Just (parseTags xs)
| x == "html" = Just (concatMap parseTags' (parseTags xs))
getHTML _ = Nothing
parseTags' (TagComment x) = parseTags x >>= parseTags'
parseTags' t = pure t
go :: HashMap Text Reference -> [Tag Text] -> HashMap Text Reference
go map (TagOpen a meta:TagText t:TagClose a':xs)
| a == "a"


Loading…
Cancel
Save