markdown-up 2.3.2 → 2.3.3
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 +6 -7
- package/package.json +1 -1
package/lib/app.js
CHANGED
|
@@ -194,10 +194,13 @@ export class MarkdownUp {
|
|
|
194
194
|
return;
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
-
// If
|
|
198
|
-
//
|
|
199
|
-
if (!isError &&
|
|
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
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);
|
|
201
204
|
}
|
|
202
205
|
}
|
|
203
206
|
|
|
@@ -347,10 +350,6 @@ export class MarkdownUp {
|
|
|
347
350
|
// Menu "burger"
|
|
348
351
|
this.burgerElements(),
|
|
349
352
|
|
|
350
|
-
// Add a top hash ID, if necessary
|
|
351
|
-
Object.keys(this.params).length === 0
|
|
352
|
-
? null : {'html': 'div', 'attr': {'id': encodeQueryString(this.params), 'style': 'display=none'}},
|
|
353
|
-
|
|
354
353
|
// Render the markdown
|
|
355
354
|
await markdownElementsAsync(markdownModel, {
|
|
356
355
|
'codeBlocks': {
|