Give user feedback when options is not parsing.
This commit is contained in:
parent
56c216a3fd
commit
a95b5bcb27
@ -65,3 +65,8 @@ header h1 {
|
||||
#preview iframe {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
#options.badParse {
|
||||
border-color: red;
|
||||
background-color: #FEE
|
||||
}
|
||||
|
@ -181,7 +181,9 @@ function checkForChanges() {
|
||||
var optionsString = $optionsElem.value || '{}';
|
||||
var newOptions = JSON.parse(optionsString);
|
||||
options = newOptions;
|
||||
$optionsElem.classList.remove('badParse');
|
||||
} catch (err) {
|
||||
$optionsElem.classList.add('badParse');
|
||||
}
|
||||
|
||||
var lexed = marked.lexer($markdownElem.value, options);
|
||||
|
Loading…
x
Reference in New Issue
Block a user