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

Escaped bullet list items get converted to bullet list items #65

Open
neopostmodern opened this issue Mar 31, 2024 · 3 comments
Open

Escaped bullet list items get converted to bullet list items #65

neopostmodern opened this issue Mar 31, 2024 · 3 comments

Comments

@neopostmodern
Copy link

Describe the bug
When inserting/importing a piece of markdown with an escaped bullet list item (e.g. \+) the item gets converted to a bullet list item (i.e. +)

To Reproduce
See this sandbox: https://codesandbox.io/p/devbox/mui-tiptap-demo-forked-nxv9m2?file=%2Fsrc%2FEditor.tsx%3A20%2C1-21%2C1

Expected behavior
The escape should be respected and a plain line beginning with a + should be preserved.

Screenshots
Example markdown (enabled breaks: true):

## Test

Regular hardbreaks
work!

Not a list
\+ Not an item

In editor:
image

Gets saved as:

## Test

Regular hardbreaks\
work!

Not a list

- Not an item

Desktop (please complete the following information):
[email protected]

Smartphone (please complete the following information):
Not tested.

Additional context
Add any other context about the problem here.

@aguingand
Copy link
Owner

aguingand commented Mar 31, 2024

You have to escape the backslash, so it should be \\+ Not an item

@neopostmodern
Copy link
Author

Sorry, that was a very stupid mistake. I messed up things when trying to create a minimal reproduction.

I've now updated the sandbox:
without breaks: true and then Markdown

Not a list\\
\\+ Not an item

renders correctly
image
BUT when you hit save you get

Not a list\
+ Not an item

...which isn't valid anymore (see also the rendered snapshot at the bottom).

So the actual bug is in the save step, not the parse/render bit.

@aguingand aguingand reopened this Apr 2, 2024
@neopostmodern
Copy link
Author

Some more detail: this scenario works just fine in it's own paragraph...

\\+ this works though\\
so it's about the combination of a hard break and a leading escape

(also added to the sandbox)

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

2 participants