mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-30 17:59:17 +08:00
Markdown reader: remove restriction on identifiers...
so they no longer need to begin with a letter. Closes #7920.
This commit is contained in:
@@ -635,7 +635,7 @@ identifier = do
|
||||
identifierAttr :: PandocMonad m => MarkdownParser m (Attr -> Attr)
|
||||
identifierAttr = try $ do
|
||||
char '#'
|
||||
result <- identifier
|
||||
result <- T.pack <$> many1 (alphaNum <|> oneOf "-_:.") -- see #7920
|
||||
return $ \(_,cs,kvs) -> (result,cs,kvs)
|
||||
|
||||
classAttr :: PandocMonad m => MarkdownParser m (Attr -> Attr)
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
```
|
||||
% pandoc -t native
|
||||
[hi]{#123}
|
||||
^D
|
||||
[ Para [ Span ( "123" , [] , [] ) [ Str "hi" ] ] ]
|
||||
```
|
||||
|
||||
```
|
||||
% pandoc -t markdown
|
||||
[hi]{#123}
|
||||
^D
|
||||
[hi]{#123}
|
||||
```
|
||||
|
||||
```
|
||||
% pandoc -t markdown
|
||||
# Hi {#123}
|
||||
^D
|
||||
# Hi {#123}
|
||||
```
|
||||
Reference in New Issue
Block a user