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

<details> element gets parsed incorrectly when using github flavoured markdown. #5606

Closed
3 tasks done
Pomax opened this issue Jan 27, 2023 · 5 comments
Closed
3 tasks done

Comments

@Pomax
Copy link

Pomax commented Jan 27, 2023

  • Searched existing issues to avoid creating duplicates. (this is not a duplicate of the several issues asking for a foldable element: if we ever get one, great, but this is a bug report specifically for <details> getting rendered incorrectly)
  • Confirmed that it can be reproduced in built-in themes without customized css.
  • Searched http://support.typora.io/ (this is an actual bug. It doesn't matter if there's a support article.)

Describe the bug

The <details> element with markdown in it, when using github flavoured markdown as markdown of choice, renders incorrectly.

To Reproduce

Create a new document, switch to source code mode, and fill it with:

This is a test

Preamble

<details>
  <summary>expand</summary>
  
  ```python
  import math
  print(f'pi has value {math.pi}')
  ```
</details>

Lead-out

Then turn off source code mode and watch Typora render the content completely wrong, showing a clickable summary that expands to "nothing", and the detail's markdown converted after the details element, with a rogue </details> in grey at the end.

Expected behavior

The markdown inside the details element should get converted just like markdown in any other block context, and the details element should get rendered as a clickable summary, expanding to reveal the converted markdown's content.

Screenshots / Screencasts

Expected result:

Expected expanded result:

Actual result:

Sample Markdown File

See above

Desktop (please complete the following information):

  • OS: windows 10 pro x64, 22h2

Typora Version
1.4.8

@Pomax Pomax changed the title <details> element gets parsed incorrectly <details> element gets parsed incorrectly when using github flavoured markdown. Jan 27, 2023
@Pomax
Copy link
Author

Pomax commented Jan 27, 2023

What it looks like right here on github, the only authority for how github flavoured markdown should get parsed:


This is a test

Preamble

expand
import math
print(f'pi has value {math.pi}')

Lead-out


As you can see, this is not supposed to render the way Typora's currently rendering it, when using github flavoured markdown.

@abnerlee
Copy link
Contributor

abnerlee commented Feb 2, 2023

#1939

@abnerlee abnerlee closed this as completed Feb 2, 2023
@Pomax
Copy link
Author

Pomax commented Feb 6, 2023

@abnerlee that's from 2018, well before Typora was a paid application. Time to close that one, and file a new one under "our github flavoured markdown parser has a demonstrable bug for paying users" =)

@syselement
Copy link

Still un-solved.
Windows Typora Version 1.5.8

Source code:

image

And Github test:

Reveal Flag🚩

FLAG

Actual Typora Result:
image

image

@Pomax
Copy link
Author

Pomax commented Feb 16, 2023

@abnerlee can we reopen this one? Because it's not a duplicate: its far more specific than the discussion that happened there, this is about Typora not using github flavoured markdown, when you tell it you're using github flavoured markdown. This is something that should be solvable independently of the issue you marked as dupe.

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