diff --git a/ElectronClient/app/gui/note-viewer/index.html b/ElectronClient/app/gui/note-viewer/index.html index f89a24e7368..93a00434c79 100644 --- a/ElectronClient/app/gui/note-viewer/index.html +++ b/ElectronClient/app/gui/note-viewer/index.html @@ -106,7 +106,6 @@ let previousContentHeight = contentElement.scrollHeight; let startTime = Date.now(); - ignoreNextScrollEvent = true; restorePercentScroll(); if (!checkScrollIID_) { @@ -114,7 +113,6 @@ const h = contentElement.scrollHeight; if (h !== previousContentHeight) { previousContentHeight = h; - ignoreNextScrollEvent = true; restorePercentScroll(); } if (Date.now() - startTime >= 1000) { diff --git a/ElectronClient/app/gui/note-viewer/preload.js b/ElectronClient/app/gui/note-viewer/preload.js index deceda30f21..a373dc61cc3 100644 --- a/ElectronClient/app/gui/note-viewer/preload.js +++ b/ElectronClient/app/gui/note-viewer/preload.js @@ -24,6 +24,14 @@ window.addEventListener('message', (event) => { const callName = event.data.name; const args = event.data.args; + // HACK + // For some reason anchors at the bottom cause the webview to move itself + // so that the content is aligned with the top of the screen + // This basically refreshes the scroll view so that is returns to a normal + // position, the scroll positions stays correct though + if (callName === "percentScroll" && args[0] === 1) + location.hash = location.hash.split('#')[0] + if (args.length === 0) { ipcRenderer.sendToHost(callName); } else if (args.length === 1) { diff --git a/ElectronClient/app/package-lock.json b/ElectronClient/app/package-lock.json index 78566353388..0466839dd1f 100644 --- a/ElectronClient/app/package-lock.json +++ b/ElectronClient/app/package-lock.json @@ -4798,9 +4798,9 @@ "integrity": "sha1-y5yf+RpSVawI8/09YyhuFd8KH8M=" }, "markdown-it-toc-done-right": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/markdown-it-toc-done-right/-/markdown-it-toc-done-right-2.1.0.tgz", - "integrity": "sha512-8VtNJ9upogHlL27OLjErFmeUu+6mKJDRFO2VtVx22NBb4GNhDLUpjkKMNkDS7BfMQiQlV2F7KDZ9VO+AHzwcVQ==" + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/markdown-it-toc-done-right/-/markdown-it-toc-done-right-3.0.1.tgz", + "integrity": "sha512-pppqoXWFyMD/JCLL7YZSYPnxJHr7DH7psXfHzTOXWof8b6XGhbCDYYha6Vi6EDwDEKY+dthNVtMSLHPlk0c1xw==" }, "match-at": { "version": "0.1.1", diff --git a/ElectronClient/app/package.json b/ElectronClient/app/package.json index 6804f5f6d62..0b23d932681 100644 --- a/ElectronClient/app/package.json +++ b/ElectronClient/app/package.json @@ -118,7 +118,7 @@ "markdown-it-multimd-table": "^3.1.3", "markdown-it-sub": "^1.0.0", "markdown-it-sup": "^1.0.0", - "markdown-it-toc-done-right": "^2.1.0", + "markdown-it-toc-done-right": "^3.0.1", "md5": "^2.2.1", "mime": "^2.3.1", "moment": "^2.22.2", diff --git a/ReactNativeClient/lib/MdToHtml.js b/ReactNativeClient/lib/MdToHtml.js index 556d9ca9f39..840fe3cb9bd 100644 --- a/ReactNativeClient/lib/MdToHtml.js +++ b/ReactNativeClient/lib/MdToHtml.js @@ -129,7 +129,7 @@ class MdToHtml { markdownIt.use(rules.code_inline(context, ruleOptions)); markdownIt.use(markdownItAnchor) if (Setting.value('plugin.toc')) - markdownIt.use(markdownItToc, { placeholder: '[[toc]]' }) + markdownIt.use(markdownItToc, { listType: 'ul' }) for (let key in plugins) { if (Setting.value('plugin.' + key)) diff --git a/ReactNativeClient/lib/models/Setting.js b/ReactNativeClient/lib/models/Setting.js index 3f576a7b435..81a81213271 100644 --- a/ReactNativeClient/lib/models/Setting.js +++ b/ReactNativeClient/lib/models/Setting.js @@ -581,7 +581,7 @@ class Setting extends BaseModel { if (name === 'sync') return _('Synchronisation'); if (name === 'appearance') return _('Appearance'); if (name === 'note') return _('Note'); - if (name === 'plugins') return _('Plugins'); + if (name === 'plugins') return _('Plugins'); if (name === 'application') return _('Application'); return name; }