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

Bold and Italic intersection incorrect Markdown #1806

Closed
Tiberiusss opened this issue Sep 23, 2021 · 2 comments
Closed

Bold and Italic intersection incorrect Markdown #1806

Tiberiusss opened this issue Sep 23, 2021 · 2 comments

Comments

@Tiberiusss
Copy link

Describe the bug

If you use bold and italic at the intersection of a word, then the output markdown will be incorrect

To Reproduce

Steps to reproduce the behavior:

  1. Go to "Wysiwyg" tab
  2. Enter text "boldanditalic"
  3. Make phrase "boldand" bold, then phrase "anditalic" italic
  4. Go to "Markdown" tab.
  5. Incorrect result is preview. Extra asterisks appeared.

image

Expected behavior

Markdown will be **bold*****and***​*italic* or **bold*****and***_italic_ and preview:
image

Editor version: 3.1.0

@Tiberiusss Tiberiusss added the Bug label Sep 23, 2021
@js87zz js87zz added the P 2 label Sep 24, 2021
@js87zz
Copy link
Contributor

js87zz commented Sep 24, 2021

@Tiberiusss
Thanks for reporting. I will fix it.

@js87zz js87zz closed this as completed Feb 4, 2022
@js87zz js87zz reopened this Feb 4, 2022
@michpalm
Copy link

michpalm commented Aug 9, 2022

I believe this I've come across the same or a similiar issue, or related at least (perhaps something about the regex in Markdown marks?). Here I've reproduced it in the example page:
2022-08-09 16 07 17

It seems like it only matches part of the syntax and ends up in a limbo state with part html/part markdown 🤔
Output after switching to markdown:

<strong>This text is bold and the last word is also *italic***

And then once again after switching to markdown once again:

<strong>This text is bold and the last word is also <em>italic</em>\*\*</strong>

Looking at the regex expression in the strong.ts file, it seems like it only matches the starting asterisks for example, if I understand it correctly (checked on regex101 website):
Screenshot 2022-08-09 at 16 16 12

kshnurov added a commit to kshnurov/tui.editor that referenced this issue Sep 19, 2022
kshnurov added a commit to kshnurov/tui.editor that referenced this issue Sep 19, 2022
kshnurov added a commit to kshnurov/tui.editor that referenced this issue Sep 26, 2022
kshnurov added a commit to kshnurov/tui.editor that referenced this issue Sep 26, 2022
kshnurov added a commit to kshnurov/tui.editor that referenced this issue Sep 26, 2022
ahamelers pushed a commit to ahamelers/tui.editor that referenced this issue Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants