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 CHANGED
@@ -194,13 +194,17 @@ export class MarkdownUp {
194
194
  return;
195
195
  }
196
196
 
197
- // If there is a URL hash ID, re-navigate to go there since it was just rendered.
198
- // The re-render is short-circuited by the unchanged hash param check above.
199
- if (!isError && getHashID(this.window.location.hash) !== null) {
200
- this.window.location.href = this.window.location.hash;
201
- } else {
202
- // Otherwise, scroll to the top of the page
203
- this.window.scrollTo(0, 0);
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
 
@@ -516,14 +516,14 @@ export const markdownScriptFunctions = {
516
516
  // $function: markdownParse
517
517
  // $group: Markdown
518
518
  // $doc: Parse Markdown text
519
- // $arg lines: The Markdown text lines (may contain nested arrays of un-split 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: The Markdown text lines (may contain nested arrays of un-split 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();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "markdown-up",
4
- "version": "2.3.4",
4
+ "version": "2.3.5",
5
5
  "description": "MarkdownUp is a Markdown viewer",
6
6
  "keywords": [
7
7
  "markdown",