Passing nonquoted boolean JSON argument to Preprocessor causes Marked to crash
Hey Brett! I think I found a crashing bug in Marked.
I have written a preprocessor script that takes two positional arguments. The first is a general string, and the second I am treating like a boolean flag. "true" and "yes" evaluate to true, otherwise false. Here's an example .md
file (this version does not crash):
<!--
Custom Preprocessor: [true, "html", "true"]
-->
# A header
Some body.
The problem arises if I'm sloppy with quotes in the arguments. Nearly every combination of quoted and unquoted arguments works fine, but if I have the first positional argument quoted, but either the values true
or false
unquoted as the second argument, Marked crashes. e.g.:
Custom Preprocessor: [true, "html", true]
I'm probably taking liberties with JSON that are inappropriate, but nevertheless this is probably an exception worth catching rather than letting Marked simply crash, yes?
Thanks as always for a great app!
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Brett on 30 Mar, 2020 04:20 PM
Yep, thanks for reporting.
- Brett