PowerToys
PowerToys copied to clipboard
HTML <details> tab breaks markdown preview
Adding collapsible section in markdown using html details tag is not supported and all of the embedded markdown in the details tag is shows as is:
Use HTML tag details <details> < summary >Click to expand!< /summary >
## Add collapsible section
1. All of this is shown
2. with
* no line breaks
* or rendering
</ details>
can you provide a file we can test against?
Not sure why you don't allow markdown files to be attached, here's it zipped.
tester.zip
Here's what the preview of it looks like
copy of MD. VS Code previews this correctly.
# heading 1
* Departure so attention pronounce satisfied daughters am. But shy tedious pressed studied opinion entered windows off. Advantage
* dependent suspicion convinced provision him yet. Timed balls match at by rooms we. Fat not boy neat left had with past here call.
* Court nay merit few nor party learn. Why our year her eyes know even how. Mr immediate remaining conveying allowance do or.
# A collapsible section with markdown
<details>
<summary>Click to expand!</summary>
## Heading 2
1. A numbered
2. list
* With some
* Sub bullets
</details>
Will shifting md preview to monaco resolve this?
No since we his is about rendering, Monaco is about viewing
Is this still an issue with the latest version?
I just tested and it's the same....
Don't think this is an issue with the actual plug-in, because there is the same result using <details> in comments like this one:
Source text - note the empty lines:
<details><summary>This does not work</summary>
This list:
- contains items
- that will not be
- correctly displayed
</details>
<details><summary>This does work</summary>
This list:
- contains items
- that **will** be
- correctly displayed
</details>
Result
This does not work
This list: - contains items - that will not be - correctly displayedThis does work
This list:
- contains items
- that will be
- correctly displayed
@Aaron-Junker do you know anything about the markdown engine?
It is the parsing engine plugin we use. We may be able to swap it out for something else but end of day, the primary goal is to help you see what is in the file, not be a perfect render.
@crutkas I agree on the (low) priority. But do you know why Github Markdown shows the exact same thing?
Cause they control the parser and rendering :). They can do whatever they want since they control all aspects of how things are interpreted and converted to HTML
Actually, it's literally mentioned here: https://gist.github.com/scmx/eca72d44afee0113ceb0349dd54a84a2#code 🤓
and here https://gist.github.com/ericclemmons/b146fe5da72ca1f706b2ef72a20ac39d
@boardtc looks like you simply need to re-write a bit - the first blank line after closing tag </summary>
is the crucial one
Hmmm... I took the sub-heading out and tried the following with the same result, don't think I missed anything?
Hmmm... I took the sub-heading out and tried the following with the same result, don't think I missed anything?
Only thing I can think of is the amount of spaces.
1. Item
* Item
I increased from 2 to 4, it makes no difference :-(
I increased from 2 to 4, it makes no difference :-(
And 3?
The general rule it's that the position of the *
must align with the first character of the previous list item.
Since you asked I tested that but the bug is not down to the spaces