mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-01 13:15:51 +00:00
This allows the combination of the fenced code block shortcut form with
attributes:
````
```haskell {.class #id}
```
````
The code syntax class will be combined with the attribute classes.
This syntax allows for more intuitive writing and for better compatibility
with other Markdown parsers such as GitHub or Codeberg.
Closes #8174.
45 lines
716 B
Markdown
45 lines
716 B
Markdown
````
|
|
% pandoc -t native
|
|
```yaml {#id}
|
|
some: code
|
|
```
|
|
^D
|
|
[ CodeBlock ( "id" , [ "yaml" ] , [] ) "some: code" ]
|
|
````
|
|
|
|
````
|
|
% pandoc -t native
|
|
```yaml {.class #id}
|
|
some: code
|
|
```
|
|
^D
|
|
[ CodeBlock
|
|
( "id" , [ "yaml" , "class" ] , [] ) "some: code"
|
|
]
|
|
````
|
|
|
|
<!-- Inline code sections at the start of the line should not be mistaken for code blocks -->
|
|
````
|
|
% pandoc -t native
|
|
```ab```
|
|
^D
|
|
[ Para [ Code ( "" , [] , [] ) "ab" ] ]
|
|
````
|
|
|
|
````
|
|
% pandoc -t native
|
|
```ab```{.class}
|
|
^D
|
|
[ Para [ Code ( "" , [ "class" ] , [] ) "ab" ] ]
|
|
````
|
|
|
|
<!-- Illegal language identifiers should be treated as inline code for now -->
|
|
````
|
|
% pandoc -t native
|
|
``` foo}{.bar}
|
|
test
|
|
```
|
|
^D
|
|
[ Para [ Code ( "" , [] , [] ) "foo}{.bar} test" ] ]
|
|
````
|