Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Text does not render if Todo list is followed by a Bulleted list that starts with a - #321

Open
TheodoreChu opened this issue Nov 10, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@TheodoreChu
Copy link

TheodoreChu commented Nov 10, 2020

Text does not render in the editor if Todo list is followed by a to-do list that starts with a -

To Reproduce
Steps to reproduce the behavior:

  1. Clone this repository
  2. Go to https://github.com/outline/rich-markdown-editor/blob/develop/example/src/index.js
  3. Replace example text (line 8) with this:

const exampleText = `- [ ] item \n- item`;

  1. Run yarn start and open the example at localhost:55555
  2. Default text doesn't render
  3. Replace the exampleText with this:

const exampleText = `- item \n- item`;

  1. Start new session to clear cache/localStorage and open the new example. The text renders

  2. Try again with this text (todo list with middle item empty):

const exampleText = `- [ ] item \n- [ ] \n- [ ] item`;

  1. Text doesn't render

Expected behavior
The todo list should render with the bulleted list below it

Version

  • Version v11.0.4

Desktop (please complete the following information):

  • OS: Windows, Ubuntu WSL 18.04 LTS
  • Browser MS Edge, Google Chrome
@TheodoreChu TheodoreChu added the bug Something isn't working label Nov 10, 2020
@tommoor
Copy link
Member

tommoor commented Nov 10, 2020

We can see if this can be fixed, but there should be an empty paragraph between lists to be valid, otherwise it's like you changed the list type half way through.

I take it the problematic input was not originally output from the editor?

@TheodoreChu
Copy link
Author

TheodoreChu commented Nov 10, 2020

I see

I take it the problematic input was not originally output from the editor?

You're right, the problematic input was not originally output from the editor. I was trying to see if my current notes are compatible with the Rich Markdown Editor when I found the issues.

I think it would be helpful to see an error message such as "The Editor could not parse the text." instead of a blank editor. Without such message, it is easy to overwrite the existing text.

@tommoor
Copy link
Member

tommoor commented Nov 10, 2020

Yep that seems fair, I think it's unlikely we'll be able to handle the list type changing part way through but the error handling can be improved at a minimum

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants