Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Support parsing markdown code within <details>. #978

Closed
yookoala opened this issue Dec 14, 2018 · 5 comments
Closed

Feature Request: Support parsing markdown code within <details>. #978

yookoala opened this issue Dec 14, 2018 · 5 comments

Comments

@yookoala
Copy link
Contributor

As a follow up to #951. Pull request #974 now supports passing on <details> and <summary> to the HTML output. But there is problem of properly displaying markdown code within the tags.

Again, you may compare the parse results between these:

If you try it, both Github and Gitlab would properly parse the code block tags ``` as source code with syntax highlight. Packagist would, in contrast, leave them as normal plain text.

The prime concern of #951 was to properly display package documentations in README files. There is was huge progress thanks to @Seldaek, but there is still work to do.

Do you think this is a packagist issue? Or do you think this is a cebe/markdown library issue (ref: cebe/markdown#163)?

@Seldaek
Copy link
Member

Seldaek commented Dec 14, 2018 via email

@yookoala
Copy link
Contributor Author

Sure. Thanks.

@stof
Copy link
Contributor

stof commented Dec 14, 2018

According to 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 this is indeed an issue of the markdown parser.
A solution could be to switch to league/commonmark as the markdown parser, as it handles it the expected way (which seems logical as both Github and Gitlab now follow the Commonmark spec for the markdown parsing).

@stof
Copy link
Contributor

stof commented Dec 14, 2018

For anyone reading this, this issue affects packages hosted on Gitlab (and other places). But packages hosted on Github are fine, because Packagist relies on Github to parse the markdown in such case (asking them for the readme in HTML format already), and so #974 made things work for that case.

@stof
Copy link
Contributor

stof commented Dec 14, 2018

note that Parsedown 1.8 (currently in beta) will also parse it properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants