markdown-up 2.3.1 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/lib/app.js +3 -3
- package/lib/scriptLibrary.js +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -113,13 +113,15 @@ Click here to [see the example in action](https://craigahobbs.github.io/markdown
|
|
|
113
113
|
### The MarkdownUp Include Library
|
|
114
114
|
|
|
115
115
|
MarkdownUp provides some additional functionality that can be included at runtime. Consider the
|
|
116
|
-
following example
|
|
116
|
+
following example that uses the
|
|
117
|
+
[unittest.mds](https://craigahobbs.github.io/markdown-up/library/include.html#var.vGroup='unittest.mds')
|
|
118
|
+
system library:
|
|
117
119
|
|
|
118
120
|
~~~
|
|
119
121
|
include <unittest.mds>
|
|
120
122
|
|
|
121
123
|
function testSanity():
|
|
122
|
-
|
|
124
|
+
unittestEqual(1 + 1, 2)
|
|
123
125
|
endfunction
|
|
124
126
|
unittestRunTest('testSanity')
|
|
125
127
|
|
package/lib/app.js
CHANGED
|
@@ -194,9 +194,9 @@ export class MarkdownUp {
|
|
|
194
194
|
return;
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
-
// If
|
|
198
|
-
// first render, re-render is short-circuited by the unchanged hash param check above.
|
|
199
|
-
if (!isError &&
|
|
197
|
+
// If the window location hash exists in the document, re-navigate there since it was just rendered.
|
|
198
|
+
// After the first render, re-render is short-circuited by the unchanged hash param check above.
|
|
199
|
+
if (!isError && this.window.document.getElementById(this.window.location.hash.slice(1)) !== null) {
|
|
200
200
|
this.window.location.href = this.window.location.hash;
|
|
201
201
|
}
|
|
202
202
|
}
|
package/lib/scriptLibrary.js
CHANGED
|
@@ -479,6 +479,12 @@ export const markdownScriptFunctions = {
|
|
|
479
479
|
// $return: The local storage value string or null if the key does not exist
|
|
480
480
|
'localStorageGet': ([key], options) => options.window.localStorage.getItem(key),
|
|
481
481
|
|
|
482
|
+
// $function: localStorageRemove
|
|
483
|
+
// $group: Local Storage
|
|
484
|
+
// $doc: Remove a browser local storage key
|
|
485
|
+
// $arg key: The key string
|
|
486
|
+
'localStorageRemove': ([key], options) => options.window.localStorage.removeItem(key),
|
|
487
|
+
|
|
482
488
|
// $function: localStorageSet
|
|
483
489
|
// $group: Local Storage
|
|
484
490
|
// $doc: Set a browser local storage key's value
|
|
@@ -486,12 +492,6 @@ export const markdownScriptFunctions = {
|
|
|
486
492
|
// $arg value: The value string
|
|
487
493
|
'localStorageSet': ([key, value], options) => options.window.localStorage.setItem(key, value),
|
|
488
494
|
|
|
489
|
-
// $function: localStorageRemove
|
|
490
|
-
// $group: Local Storage
|
|
491
|
-
// $doc: Remove a browser local storage key
|
|
492
|
-
// $arg key: The key string
|
|
493
|
-
'localStorageRemove': ([key], options) => options.window.localStorage.removeItem(key),
|
|
494
|
-
|
|
495
495
|
|
|
496
496
|
//
|
|
497
497
|
// Markdown functions
|