-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Markdown reader: fenced code block shortcuts with attributes (#8174)
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.
- Loading branch information
Showing
3 changed files
with
63 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
```` | ||
% 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" ] ] | ||
```` |