Git Product home page Git Product logo

Comments (3)

chrisjsewell avatar chrisjsewell commented on May 24, 2024 1

No problem, I've added the documentation now in #117. Take a look at https://272-240151150-gh.circle-artifacts.com/0/html/using/syntax.html#comments

from myst-parser.

chrisjsewell avatar chrisjsewell commented on May 24, 2024

So, this is the actual docutils AST rendered:

line 1
% a comment
line 2
<document source="notset">
    <paragraph>
        line 1
    <comment xml:space="preserve">
        a comment
    <paragraph>
        line 2

This is the 'correct' behaviour, given the fact that (as it stands) a LineComment is defined as a block level entity,
such that when one is found the current block element is terminated (in this case a paragraph).

What you are after here is a span level (a.k.a inline) comment entity, whereby the comment is parsed as:

<document source="notset">
    <paragraph>
        line 1
        <comment xml:space="preserve">
            a comment
        line 2

This essentially would require an additional syntax element to be implemented, which would be fairly tricky, so I can't promise I could achieve this any time soon.

Perhaps at a minimum the documentation should make this clear.

from myst-parser.

rossbar avatar rossbar commented on May 24, 2024

Got it, thanks for clarification. It's not fair to blame this on the documentation necessarily - I had barreled ahead without realizing the distinction between the line comment and inline comments 😑 . That said, I will take a closer look to see if an extra example in the docs wouldn't hurt.

from myst-parser.

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.