From a95b5bcb27f8ddf79886429e0fa4de0b3f94d867 Mon Sep 17 00:00:00 2001 From: Aprotim Sanyal Date: Thu, 18 Oct 2018 00:56:29 -0700 Subject: [PATCH 1/2] Give user feedback when options is not parsing. --- docs/demo/demo.css | 5 +++++ docs/demo/demo.js | 2 ++ 2 files changed, 7 insertions(+) diff --git a/docs/demo/demo.css b/docs/demo/demo.css index 66b870adad..cf116bfc2a 100644 --- a/docs/demo/demo.css +++ b/docs/demo/demo.css @@ -65,3 +65,8 @@ header h1 { #preview iframe { flex-grow: 1; } + +#options.badParse { + border-color: red; + background-color: #FEE +} diff --git a/docs/demo/demo.js b/docs/demo/demo.js index 09b30dc204..7da5fe3b9a 100644 --- a/docs/demo/demo.js +++ b/docs/demo/demo.js @@ -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); From edaddacb12adf0b9ab9d64c252fb3cd2f60b2412 Mon Sep 17 00:00:00 2001 From: aprotim Date: Fri, 19 Oct 2018 10:54:11 -0700 Subject: [PATCH 2/2] Options input shouldn't be resizeable A change in the CSS snuck in from a previous iteration of the demo page options UI. Remove it. --- docs/demo/demo.css | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docs/demo/demo.css b/docs/demo/demo.css index cf116bfc2a..92d2f4a504 100644 --- a/docs/demo/demo.css +++ b/docs/demo/demo.css @@ -45,10 +45,6 @@ header h1 { box-sizing: border-box; } -#options { - resize: both; -} - .pane, .inputPane { margin-top: 5px; padding: 0.6em;