mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-23 16:05:54 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user