On Inkdrop for Mac, the preview panel crashes when I type JSX code that uses inline stylesheets.
Error message is: " Failed to render Markdown - If the problem persists, please report it. Sorry for the inconvenience".
Sample error log is here: https://pastebin.com/qm9sScjb
Info
Platform: macOS
Platform version: Mojave
App Version: 3.23.2
Reproduce
Paste the following text in a new note. Donāt apply any formatting, just put the raw text in the note.
<p style={{fontSize:'20px'}}>
Hereās another example:
<div style={divStyle}>
<p style={pStyle}>Get started with inline style</p>
</div>
Thank you for reporting.
Thatās not a bug because Markdown doesnāt support JSX syntax, just like browsers canāt parse it as HTML.
You have to enclose JSX code with ``` like so:
```
<p style={{fontSize:'20px'}}>
```
If you want to specify custom style in your inline html, write plain css in style attribute:
Hi, and thanks for your reply.
I wasnāt expecting JSX support, and I know I can use backticks. I just wasnāt expecting a one-page error log filling the preview window, just because I forgot the backticks
Perhaps the preview panel should just ignore JSX code and show it as it is, instead of trying to parse it - just like a web browser does for bad HTML code.
Anyway thatās just a suggestion, more ācosmeticā than else. Thanks for the support, and for an excellent piece of software!
An application crashing because of bad user input is a standard example of a use case to prevent. Every software quality and user experience manual will tell you that users will input a lot of things which you would not expect as a developer and applications should be solid enough to deal with bad input (in this case JSX without code block).
Iām quite shocked that Inkdrop crashing is considered okay behavior!