giving up and having an LLM do markdown parser next commit
This commit is contained in:
parent
57126ef6be
commit
010351c6b1
1 changed files with 11 additions and 5 deletions
|
|
@ -66,17 +66,23 @@ htmlInline = do
|
||||||
remaining <- htmlInlineRemainder
|
remaining <- htmlInlineRemainder
|
||||||
whiteSpace
|
whiteSpace
|
||||||
char '>'
|
char '>'
|
||||||
let remainingTagText = foldl' (\ongoing current -> ongoing ++ ' ' : current) "" remaining
|
let remainingTagText = foldl' (\ongoing current -> ongoing ++ ' ' : current) "" remaining
|
||||||
|
|
||||||
pure $ HTMLIn $ pack $ '<' : name ++ remaining
|
pure $ HTMLIn $ pack $ '<' : name ++ remaining
|
||||||
where
|
where
|
||||||
htmlInlineRemainder = many $ whiteSpace *> attribute
|
htmlInlineRemainder = many $ whiteSpace *> attribute
|
||||||
name = many $ choice [alphaNum, char '-', char ':']
|
name = many $ choice [alphaNum, char '-', char ':']
|
||||||
|
value = do
|
||||||
|
char '"'
|
||||||
|
l <- letter
|
||||||
|
rem <- many $ choice [alphaNum, char '-', char ':']
|
||||||
|
char '"'
|
||||||
|
pure '"' : l : rem ++ "\""
|
||||||
attribute = do
|
attribute = do
|
||||||
attrName <- name
|
attrName <- name
|
||||||
char '='
|
char '='
|
||||||
attrValue <- value
|
attrValue <- value
|
||||||
pure attrName ++ '=' :
|
pure attrName ++ ('=' : attrValue)
|
||||||
|
|
||||||
whiteSpace :: Parser Text
|
whiteSpace :: Parser Text
|
||||||
whiteSpace = pack <$> many space
|
whiteSpace = pack <$> many space
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue