From 14da71c5cb3a42e2154407c5f4d9760d9b2ae32a Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Thu, 14 Feb 2019 11:52:14 -0600 Subject: [PATCH] clean up more code --- docs/demo/demo.js | 4 ++-- docs/demo/index.html | 2 +- docs/demo/initial.md | 2 +- docs/demo/worker.js | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/demo/demo.js b/docs/demo/demo.js index 2e5198adb3..de6882a5be 100644 --- a/docs/demo/demo.js +++ b/docs/demo/demo.js @@ -80,7 +80,7 @@ Promise.all([ }); function setInitialText() { - if (search.text) { + if ('text' in search) { $markdownElem.value = search.text; } else { return fetch('./initial.md') @@ -148,7 +148,7 @@ function setInitialVersion() { } function setInitialOptions() { - if (search.options) { + if ('options' in search) { $optionsElem.value = search.options; } else { setDefaultOptions(); diff --git a/docs/demo/index.html b/docs/demo/index.html index 7d21663695..96a8ec14b1 100644 --- a/docs/demo/index.html +++ b/docs/demo/index.html @@ -58,7 +58,7 @@

Marked Demo

- + diff --git a/docs/demo/initial.md b/docs/demo/initial.md index 2465aef041..d2b7d77c10 100644 --- a/docs/demo/initial.md +++ b/docs/demo/initial.md @@ -30,7 +30,7 @@ It's easy. It's not overly bloated, unlike HTML. Also, as the creator of [mark > or formatting instructions. Ready to start writing? Either start changing stuff on the left or -[clear everything](?text=) with a simple click. +[clear everything](/demo/?text=) with a simple click. [Marked]: https://github.com/markedjs/marked/ [Markdown]: http://daringfireball.net/projects/markdown/ diff --git a/docs/demo/worker.js b/docs/demo/worker.js index cb189390aa..06b8befe78 100644 --- a/docs/demo/worker.js +++ b/docs/demo/worker.js @@ -83,7 +83,7 @@ function jsonString(input) { function loadVersion(ver) { var promise; - if (ver in versionCache) { + if (versionCache[ver]) { promise = Promise.resolve(versionCache[ver]); } else { promise = fetch(ver)