Comments (12)
Let's see what GFM does with it:
``` python more
hi
```
becomes
hi
and there is no trace of more
in the rendered HTML. So this behavior is implementing a kind of standard. But you're right that we could, in principle, treat the rest as additional attributes. But how? Split by spaces and make them classes? What if there is punctuation not normally allowed in classes?
from djot.
Let's see what GFM does with it
Commonmark stores the entire first line as info
: https://spec.commonmark.org/dingus/?text=%60%60%60name%20a%0Acontent%0A%60%60%60%0A%0A
from djot.
I've revised my note above.
from djot.
Split by spaces and make them classes? What if there is punctuation not normally allowed in classes?
Do you need to split it at all? Just have the whole string be the lang
For div
, hmmm; firstly I would ask, is there really a need to have this "store the first word as a class" semantics?
You already have block attributes for setting classes, why not just store ithe whole string under a key as well and be done with it π
from djot.
(thanks as always for the rabid rapid replies!)
from djot.
rabid π
Pandoc doesn't store these in the lang
attribute; it adds them as classes. (This is the way it has always behaved, and changing it now is probably not a good idea.)
from djot.
rabid π
π π€¦ββοΈ
from djot.
Pandoc
This is the way it has always behaved, and changing it now is probably not a good idea
Does djot have to do what pandoc does though?
from djot.
It seems like Pandoc does not follow commonmark here π€ https://spec.commonmark.org/0.30/#info-string
from djot.
Pandoc's commonmark and gfm and commonmark_x parsers will ignore the additional content in the case of code blocks. This could be modified to store the whole line in an info
attribute, or perhaps to do so only if this content would differ from the class already stored.
Pandoc's markdown parser is different. Part of the motivation here is to avoid confusing inline code that happens to start at the beginning of the line and uses three backticks with a code block.
from djot.
Part of the motivation here is to avoid confusing inline code that happens to start at the beginning of the line and uses three backticks with a code block.
It feels like, if you have "committed" to writing three backticks at the start of the line, then you are expecting to write a code block.
I can't imagine there being any time that you actually want this as inline?
Note, commonmark prohibits backticks being in the info string (then it is parsed as inline), so you can still write inline:
```inline something```
just not
```inline something
```
from djot.
``` ``Markdown code spans with ` inside them`` ``` can be quoted with ` ``` `.
Let's see how GH renders it:
``Markdown code spans with ` inside them``
can be quoted with ```
.
from djot.
Related Issues (20)
- Tables with a column of th elements HOT 1
- Typo in syntax.md
- Proposal: Punctuation Character for Code Block's language specifier HOT 6
- Playground: slow on Safari HOT 5
- Supporting βcommandsβ in addition to βclassesβ in attributes? HOT 2
- Hard-wrapping: require subsequent lines to be indented/quoted? HOT 6
- Two asterisks for βstrongβ? HOT 3
- Inline footnotes?
- Support `<dfn>`, `<cite>` and `<i>`? HOT 2
- Parsing inconsistency: lazy paragraph lines in lists HOT 4
- The closing delimiter of a div block can interrupt a paragraph HOT 4
- Should block attributes mark a div block delimiter as opening? HOT 1
- section nesting for non-consecutive heading levels HOT 1
- [Proposal] more permissive definition of allowed symbol syntax HOT 43
- [Proposal] Remove leading whitespace HOT 2
- Allow any valid HTML4 identifier string to be a djot identifier string HOT 2
- Allow underscore in task list to denote unchecked item HOT 2
- loose list appears unexpectedly when using tight lists HOT 4
- Use `![alt](path)` syntax not only to include images, but also text files HOT 9
- The definition item in a descrition list is always a paragraph HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from djot.