Giter Club home page Giter Club logo

Comments (3)

karlb avatar karlb commented on August 24, 2024

What would be the rule? I don't think this should apply for all top level tags. E.g.

Welcome!

<b>Be nice to each other!<b>

Thanks.

should add paragraph tags around each block including the middle one. So would they only be left out for block level tags?

from smu.

clark800 avatar clark800 commented on August 24, 2024

Yeah, I think changing the behavior for block-level tags only would make sense. Then somehow disable markdown processing until the corresponding closing tag. Maybe keep a counter of non-commented, non-quoted open (+1) and close (-1) tags of the same tag type and it ends when the counter reaches zero? I think it's fair to assume that the HTML is valid and tags/comments/quotes are balanced. If that's too complicated, I think you could also just count the tags that start at the beginning of the line and make it a user requirement that these are not commented or quoted.

from smu.

clark800 avatar clark800 commented on August 24, 2024

Looks like the official rules say that block-level tags should be treated differently:

The only restrictions are that block-level HTML elements — e.g. <div>, <table>, <pre>, <p>, etc. 
— must be separated from surrounding content by blank lines, and the start and end tags of the 
block should not be indented with tabs or spaces. Markdown is smart enough not to add extra 
(unwanted) <p> tags around HTML block-level tags.

https://daringfireball.net/projects/markdown/syntax#html

Based on the description, it sounds like just counting corresponding open and close tags at the beginning of lines would be sufficient.

from smu.

Related Issues (9)

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.