File tree Expand file tree Collapse file tree 2 files changed +56
-0
lines changed Expand file tree Collapse file tree 2 files changed +56
-0
lines changed Original file line number Diff line number Diff line change @@ -56,3 +56,21 @@ Similarly, inline executable code cells have the language attribute declared ins
5656code non-executable inline code elements have attributes declared outside the ticks.
5757We could improve all of this.
5858
59+ ## Notes
60+
61+ ### 2:04PM
62+
63+ ```
64+ $ pandoc -f markdown to native
65+ ## Hello {#id .class key=value}
66+ ^D
67+ [ Header
68+ 2
69+ ( "id" , [ "class" ] , [ ( "key" , "value" ) ] )
70+ [ Str "Notes" ]
71+ ]
72+ ```
73+
74+ Pandoc supports attributes at the end of ATX heading lines as the above example.
75+ This seems hard to do in the way that ` tree-sitter-markdown ` is structured, because the
76+ entire line starting with ` ## ` is sent to the ` inline ` grammar.
Original file line number Diff line number Diff line change 1+ ---
2+ title : Syntax errors are Good, Actually
3+ author : Carlos
4+ date : 2025-03-03
5+ categories :
6+ - syntax
7+ ---
8+
9+ I consider the following [ sentence in the CommonMark spec] ( https://spec.commonmark.org/0.31.2/#preliminaries ) to be a fatal flaw in its design:
10+
11+ > Any sequence of characters is a valid CommonMark document.
12+
13+ Syntax errors are good!
14+ People make typos; a good language makes it so that common typos are obviously detectable.
15+ Imagine ifevery sequence of characters were a valid English word.
16+ The reason it isn't the case, of course, is that languages that are bad like this are selected away.
17+
18+ Why is CommonMark making this obvious mistake?
19+ I don't understand it.
20+ A lack of errors isn't a kindness to novice users.
21+ It's the other way around!
22+
23+ Incidentally, this is another thing that [ Typst] ( https://typst.app/docs/ ) gets right.
24+ You get _ excellent_ syntax errors and linting when using Typst.
25+ That's how it should be!
26+
27+ And that's what we're going to try in Quarto Markdown.
28+ A syntax that's as close to Markdown as we can make it, but for which you get proper syntax errors.
29+
30+ Consider [ Example 307] ( https://github.github.com/gfm/#example-307 ) from the GFM spec:
31+
32+ > Input: `` `hi`lo` ``
33+ >
34+ > Output: `` <p><code>hi</code>lo`</p> ``
35+
36+ This really should be a syntax error.
37+ Mismatched backquotes should be disallowed, and "naked" backquotes should be escaped (likely with a backslash).
38+ I'm not sure how many of these classes of examples we will be able to convert, but it should give you an idea
You can’t perform that action at this time.
0 commit comments