giving up and having an LLM do markdown parser next commit

This commit is contained in:
Pagwin 2025-11-01 15:36:04 -04:00
parent 57126ef6be
commit 010351c6b1
No known key found for this signature in database
GPG key ID: 81137023740CA260

View file

@ -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