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

Distinct bold and newline issue (bolded empty lines) #658

Open
jywarren opened this issue Nov 17, 2020 · 2 comments
Open

Distinct bold and newline issue (bolded empty lines) #658

jywarren opened this issue Nov 17, 2020 · 2 comments
Labels
Milestone

Comments

@jywarren
Copy link
Member

I'm seeing an issue distinct from #457 but also to do with bold and newlines. It's not clear to me if it's fixed in jywarren/woofmark#1, but we can probably test in GitPod there.

What happens is that if (in rich text) we make 2 new lines after bolding a line, then type, it's bold (which is OK, although we could change that if it makes a solution easier). Then, if we unbold the text on the 2nd new line, and keep typing, things seem normal... but in fact there is a double ** left on 2 consecutive lines due to the remaining "bolded" newline (which has no text on it). This the causes ** to appear in markdown mode when we switch to it, and on switching back to rich text, triggers a formatting error:

bold

What I think we should do is filter out newlines that contain only formatting and no content (or only whitespace). We could do this upon switching modes between rich and markdown.

We could also try writing a test for this behavior, in:

https://github.com/publiclab/PublicLab.Editor/blob/cf1fc4a9c4b70afaede856bac214e27388ab6cfa/test/ui-testing/bold.test.js

@jywarren
Copy link
Member Author

I've tried to create a test for this now!

@jywarren
Copy link
Member Author

Also noting #4 may solve this but needs to be tested... jywarren/woofmark#4

@jywarren jywarren added this to the v3.1 milestone Oct 5, 2021
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

1 participant