GithubHelp home page GithubHelp logo

Comments (5)

DivineDominion avatar DivineDominion commented on July 28, 2024

For context: after a fenced code block, the empty line is indeed tokenized as a BLOCK_EMPTY with a TEXT_NL token inside, so I guess the "smearing together" of indented code lines into a cohesive block across empty lines is being too greedy at the bottom edge

By "smearing together" I mean that these 3 lines become 1 cohesive block even though the middle line doesn't even have indentation characters ( denoting a space):

␣␣␣␣line 1 of code

␣␣␣␣line 3 of same block

from multimarkdown-6.

fletcher avatar fletcher commented on July 28, 2024

I'm struggling to understand under what circumstances this would matter?

The token tree does not describe the given source text (that is "described" by text itself), it is an abstract representation of the semantic meaning of the text. There are circumstances where a BLOCK_EMPTY has meaning (in the sense that it splits something else into two or more parts) and circumstances where it does not (an indented code block ends when there is a non-indented line, whether there is an intervening blank line or not.) This means that there are circumstances where one or more empty lines are assumed, and times where they are explicitly noted -- and this often has to do with technical limitations of the parser, and sometimes just because I happened to code it differently. This includes the fact that I don't always explicitly waste the CPU cycles to remove a token that is no longer needed and sometimes just mark it as an empty token and allow it to be freed later.

Either way, a BLOCK_EMPTY token results in NULL output, so its presence or absence in the token tree doesn't really matter, since the parsing has already been completed at this point.

Perhaps you could explain why this came up?

from multimarkdown-6.

DivineDominion avatar DivineDominion commented on July 28, 2024

Thanks for the explanation! I wanted to report this because it looked odd that the token tree's description had gaps: If the code block continued one line further down, I would have just thought that this is MMD6's way to interpret the situation. The gap looked suspicious and I didn't notice any mentioning of intentional gaps in the headers or source files, so I figured you might not be aware of this as well.

So this is a "wontfix because intentional" situation :)

from multimarkdown-6.

fletcher avatar fletcher commented on July 28, 2024

Or maybe a "quasi-intentional" situation and will consider fixing if there is a situation where it actually matters.

:)

from multimarkdown-6.

fletcher avatar fletcher commented on July 28, 2024

(But thank you for noticing!!)

from multimarkdown-6.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.