Markdown reader: handle 'id' and 'class' in parsing key/value attrs.
# Header {id="myid" class="foo bar"} is now equivalent to # Header {#myid .foo .bar} Closes #2396.
This commit is contained in:
parent
8a43530380
commit
dcb0b02aa3
1 changed files with 5 additions and 1 deletions
|
@ -639,7 +639,11 @@ keyValAttr = try $ do
|
|||
val <- enclosed (char '"') (char '"') litChar
|
||||
<|> enclosed (char '\'') (char '\'') litChar
|
||||
<|> many (escapedChar' <|> noneOf " \t\n\r}")
|
||||
return $ \(id',cs,kvs) -> (id',cs,kvs ++ [(key,val)])
|
||||
return $ \(id',cs,kvs) ->
|
||||
case key of
|
||||
"id" -> (val,cs,kvs)
|
||||
"class" -> (id',cs ++ words val,kvs)
|
||||
_ -> (id',cs,kvs ++ [(key,val)])
|
||||
|
||||
specialAttr :: MarkdownParser (Attr -> Attr)
|
||||
specialAttr = do
|
||||
|
|
Loading…
Reference in a new issue