Open Bistard opened 3 weeks ago
I don't think it is consistent. If you would like to create a PR to make it consistent we could get it in the next major version. 😁👍
OK. In the next few days or weeks, I will look up the source code and try to make it consistent through a PR.
Marked version: 14.1.2
Background
This is not a bug, but rather a confusion from me. Consider the following text and tokenization result:
I notice that the end of the line character
\n
only exists at thetoken.raw
and undetectable under its children tokens ortoken.text
. This is also confirmed by this previous issue I asked.Expected behavior
My question is: Does this behaviour work for EVERY block-level token? That is, for every block-level token, when a '\n' character is at the end of that block, is it always only accessible and detectable in the
token.raw
property?Example
I tested
list
,paragraph
,heading
,codeBlock
,blockQuote
in the official demo website. They seem to follow my expectations.For example, the tokenization result from
heading
,codeBlock
andBlockQuote
tokens in my case is the following:But I tried
html
token, seems like an exception:Additionals
For
hr
token, since it only has thetoken.raw
property but notoken.text
property, so this block-level token is not in the range of my question: