dalyIsaac / onenote-markdown

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

Inline styling isn't preserved for all `StructureNode` elements. #35

Closed dalyIsaac closed 5 years ago

dalyIsaac commented 5 years ago

The inline styling for the below HTML is not found in the rendered React output.

<p id="p:{28216e73-1f0a-05fd-25c5-a04844147e70}{19}" style="color:#595959;font-style:italic;margin-top:0pt;margin-bottom:0pt">
    Quote
</p>
dalyIsaac commented 5 years ago

The problem isn't with the actual source code - it's the sample HTML given to the parser.

What was given was:

  `<p id="p:{28216e73-1f0a-05fd-25c5-a04844147e70}{19}" ` +
  `style="color:#595959;font-style:italic;margin-top:0pt;margin-bottom:0pt">` +
  `Quote` +
  `</p>`

The lack of a space between id="p:{28216e73-1f0a-05fd-25c5-a04844147e70}{19}" and ` + caused the parser to ignore the following attributes, as it expected the lexer to return the next type to be "space".