]> BookStack Code Mirror - bookstack/commitdiff
Fixes a corner case with exclamation in the ID. 875/head
authorAbijeet <redacted>
Sun, 10 Jun 2018 11:59:30 +0000 (17:29 +0530)
committerAbijeet <redacted>
Sun, 10 Jun 2018 11:59:30 +0000 (17:29 +0530)
Signed-off-by: Abijeet <redacted>
resources/assets/js/components/wysiwyg-editor.js

index a094359eced82de020133117046184ab0d7f4ba7..a8a2ff175ed0c732b38cbe06be3fa394031c4694 100644 (file)
@@ -501,7 +501,7 @@ class WysiwygEditor {
                 }
 
                 function scrollToText(scrollId) {
                 }
 
                 function scrollToText(scrollId) {
-                    const element = editor.dom.get(scrollId)
+                    const element = editor.dom.get(encodeURIComponent(scrollId).replace(/!/g, '%21'));
                     if (!element) {
                         return;
                     }
                     if (!element) {
                         return;
                     }