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

<br> tag added by WYSIWYG produces markdown that does not render correctly #2586

Open
blikblum opened this issue Jul 1, 2022 · 1 comment
Labels

Comments

@blikblum
Copy link

blikblum commented Jul 1, 2022

Describe the bug

When a br tag is present followed by a text with a link, the link is not rendered as html when parsed by marked and dingus (commonmark spec parser)
This occurs when using TUI Editor in WYSIWYG mode

To Reproduce

Steps to reproduce the behavior:

  1. Start editor in WYSIWYG
  2. Add two or more new lines
  3. Add a text followed by a link
  4. Use getMarkdown api
# Hello

Text

<br>
Hello [link](https://marked.js.org/) 

Dingus: https://spec.commonmark.org/dingus/?text=%23%20Hello%0A%0AText%0A%0A%3Cbr%3E%0AHello%20%5Blink%5D(https%3A%2F%2Fmarked.js.org%2F)%20%0A%0A

Marked: https://marked.js.org/demo/?text=%23%20Hello%0A%0AText%0A%0A%3Cbr%3E%0AHello%20%5Blink%5D(https%3A%2F%2Fmarked.js.org%2F)%20%0A&options=%7B%0A%20%0A%7D&version=master

Expected behavior

The produced markdown should be rendered by spec compliant parsers like marked and dingus

Screenshots

If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Linux
  • Browser Firefox
  • Version Ubuntu 20.4

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context

Adding a new line after br tag, fixes the issue:

https://spec.commonmark.org/dingus/?text=%23%20Hello%0A%0AText%0A%0A%3Cbr%3E%0A%0AHello%20%5Blink%5D(https%3A%2F%2Fmarked.js.org%2F)%20%0A%0A

@ethanfann
Copy link

ethanfann commented Jul 19, 2023

Same thing happens with <br> followed by a header, and the header won't be correctly rendered.

Example:

<br>
# This WILL NOT WORK

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

No branches or pull requests

2 participants