dalyIsaac / onenote-markdown

https://onenote-markdown.azurewebsites.net/
MIT License
43 stars 2 forks source link

Unterminated tags written inside the markdown editor cause the application to break. #40

Closed dalyIsaac closed 5 years ago

dalyIsaac commented 5 years ago

Repro steps

  1. Load the sample OneNote page
  2. Type {color:red}

Current behavior

React throws an error:

Invariant Violation: Objects are not valid as a React child (found: object with keys {node}). If you meant to render a collection of children, use an array instead.

Expected behavior

The unterminated tag is terminated automatically at the end of the StructureNode.

dalyIsaac commented 5 years ago

Fix: added a renderer for unfinishedEnd tokens.

EDIT: unfinished custom markdown tags inserted at the end of a StructureNode causes:

Error: There's a mismatch between the number of start and end tags