markdown-up 2.3.4 → 2.3.5
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/lib/app.js +11 -7
- package/lib/scriptLibrary.js +2 -2
- package/package.json +1 -1
package/lib/app.js
CHANGED
|
@@ -194,13 +194,17 @@ export class MarkdownUp {
|
|
|
194
194
|
return;
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
-
//
|
|
198
|
-
|
|
199
|
-
if (!isError &&
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
197
|
+
// URL hash ID?
|
|
198
|
+
const hashId = getHashID(this.window.location.hash);
|
|
199
|
+
if (!isError && hashId !== null) {
|
|
200
|
+
// Special "top" hash ID?
|
|
201
|
+
if (hashId === 'top' && this.window.document.getElementById(this.window.location.hash.slice(1)) === null) {
|
|
202
|
+
this.window.scrollTo(0, 0);
|
|
203
|
+
} else {
|
|
204
|
+
// Re-navigate to scroll to the hash ID since it was just rendered. The re-render is
|
|
205
|
+
// short-circuited by the unchanged hash param check above.
|
|
206
|
+
this.window.location.href = this.window.location.hash;
|
|
207
|
+
}
|
|
204
208
|
}
|
|
205
209
|
}
|
|
206
210
|
|
package/lib/scriptLibrary.js
CHANGED
|
@@ -516,14 +516,14 @@ export const markdownScriptFunctions = {
|
|
|
516
516
|
// $function: markdownParse
|
|
517
517
|
// $group: Markdown
|
|
518
518
|
// $doc: Parse Markdown text
|
|
519
|
-
// $arg lines
|
|
519
|
+
// $arg lines...: The Markdown text lines (may contain nested arrays of un-split lines)
|
|
520
520
|
// $return: The [Markdown model](https://craigahobbs.github.io/markdown-model/model/#var.vName='Markdown')
|
|
521
521
|
'markdownParse': (lines) => parseMarkdown(lines.flat()),
|
|
522
522
|
|
|
523
523
|
// $function: markdownPrint
|
|
524
524
|
// $group: Markdown
|
|
525
525
|
// $doc: Render Markdown text
|
|
526
|
-
// $arg lines
|
|
526
|
+
// $arg lines...: The Markdown text lines (may contain nested arrays of un-split lines)
|
|
527
527
|
'markdownPrint': (lines, options) => {
|
|
528
528
|
const {runtime} = options;
|
|
529
529
|
runtime.setMarkdown();
|