Giter VIP home page Giter VIP logo

Comments (6)

yookoala avatar yookoala commented on June 2, 2024

Real-life example: Same README on different platforms

from markdown.

yookoala avatar yookoala commented on June 2, 2024

composer/packagist#974 has fixed the problem displaying the HTML tags <summary> and <details>. But the markdown within the tag is not parsed normally. I'm not sure if it is caused by this library, or how Packagist is using it.

from markdown.

yookoala avatar yookoala commented on June 2, 2024

As reported in composer/packagist#978, @Seldaek pointed out it is likely to be a problem in the markdown library. Quote:

I saw that but I believe it's the markdown parser at fault as the backticks remain in the output. So I figured your issue there was covering it already and decided to close on our side.

from markdown.

stof avatar stof commented on June 2, 2024

See http://johnmacfarlane.net/babelmark2/?normalize=1&text=%3Cdetails%3E%3Csummary%3ESome+PHP+example+(collapsed)%3C%2Fsummary%3E%0A%0A%60%60%60php%0A%3C%3Fphp%0A%0A%2F%2F+this+is+a+comment%0Aecho+%22hello+world%22%3B%0A%0A%3F%3E%0A%60%60%60%0A%0A%3C%2Fdetails%3E for a comparison of the different markdown parsers for that input.

from markdown.

cebe avatar cebe commented on June 2, 2024

But the markdown within the tag is not parsed normally. I'm not sure if it is caused by this library, or how Packagist is using it.

This is expected because markdown is not parsed inside HTML blocks.

https://daringfireball.net/projects/markdown/syntax#html
Note that Markdown formatting syntax is not processed within block-level HTML tags. E.g., you can’t use Markdown-style emphasis inside an HTML block.

As github is doing it we might add that feature to the GithubMarkdown class.

Btw, I was not aware that packagist is using this library :)

from markdown.

stof avatar stof commented on June 2, 2024

@cebe CommonMark (which GFM is based on now) defines that it is processed if there are empty lines between the HTML markup and the Markdown markup (which probably means it does not require balanced tags in the HTML blocks, and so the empty line makes the structure be HTML > MD > HTML instead of just HTML, but I haven't checked in the spec).

See http://johnmacfarlane.net/babelmark2/?normalize=1&text=%3Cdetails%3E%3Csummary%3ESome+PHP+example+(collapsed)%3C%2Fsummary%3E%0A%60%60%60php%0A%3C%3Fphp%0A%0A%2F%2F+this+is+a+comment%0Aecho+%22hello+world%22%3B%0A%0A%3F%3E%0A%60%60%60%0A%3C%2Fdetails%3E for the similar input without the empty lines. commonmark.js will not parse the codeblock anymore in that case.

from markdown.

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.