Giter VIP home page Giter VIP logo

Comments (7)

puzrin avatar puzrin commented on May 18, 2024

That's a CommonMark specification problem. It was already reported, and now in process of discussion:

http://talk.commonmark.org/t/raw-html-blocks-proposals-comments-wanted/983

I think, spec will resolve it in < 1 months, and i update parser immediately then. Is it ok?

from markdown-it.

robogeek avatar robogeek commented on May 18, 2024

I tried to read that but it got pretty technical, so I'm not quite understanding the proposal. It does explain why I'd seen a difference between a tag at the beginning of the line, and tags in the middle of some text.

For my purpose it's not useful to only support non-standard tags at the beginning of a line. They need to be supported anywhere (for my purpose).

At the moment I'm trying a workaround to use earlier versions of markdown-it or might have to switch back to Remarkable ...

from markdown-it.

puzrin avatar puzrin commented on May 18, 2024

Hm... they have the same codebase, and i don't remember that changed html tags logic. Are you sure it worked better before?

from markdown-it.

puzrin avatar puzrin commented on May 18, 2024

Version from master should eat dash in tag names now. But it you need those tags to be block-like (not wrapped with paragraphs), you have to extend this list https://github.com/markdown-it/markdown-it/blob/master/lib/common/html_blocks.js

var blockTags = require('markdown-it/lib/common/html_blocks');

blockTags.push('my-block-tag');

Also i recommend to read upcoming spec changes and write there your suggestions, if you see any problems. This parser strictly follow CommonMark spec.

In worst case, you can rewrite approproate parcer rules with your own.

from markdown-it.

puzrin avatar puzrin commented on May 18, 2024

I tried to read that but it got pretty technical, so I'm not quite understanding the proposal. It does explain why I'd seen a difference between a tag at the beginning of the line, and tags in the middle of some text.

http://spec.commonmark.org/0.15/#html-blocks

Your tag could work if it was the part of html block. For example:


<!-- -->
<hello-world></hello-world>

When parser find start of html block (<!--) in this case, it takes as html everything until next empty line.

from markdown-it.

puzrin avatar puzrin commented on May 18, 2024

Released 3.0.2 with allowed dashes in tag names.

Closing?

from markdown-it.

robogeek avatar robogeek commented on May 18, 2024

Yes it looks good. Thank you.

from markdown-it.

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.