Error saving pages when copying content from a webpage which uses highlight.js #1713

Closed
opened 2026-02-05 01:41:27 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @Knaui on GitHub (May 5, 2020).

saving a change to a page in bookstack is broken if the change includes copying content with highlight.js, for example from a webpage or wallabag page.

code example from webpage or wallabag:

a2enmod 
php7.2
systemctl 
restart apache2

<pre class="hljs properties">
<span class="hljs-attr">a2enmod</span>
<span class="hljs-string">php7.2</span>
<span class="hljs-attr">systemctl</span>
<span class="hljs-string">restart apache2</span>
</pre>

"wallabag" highlights code in articles using highlight.js since version 2.3.3, many blogs and other help guides on the internet use it too.

every line of text before the hightlight.js code is ok - everything after is not saved and "missing"

The revisions are saved although no changes are saved - regardless of how often i try, the page stays empty.

also i get a browser (firefox) error message when clicking save "are you sure you want to leave this page... ?"

tested with BookStack version v0.29.0

Originally created by @Knaui on GitHub (May 5, 2020). saving a change to a page in bookstack is broken if the change includes copying content with highlight.js, for example from a webpage or wallabag page. code example from webpage or wallabag: <pre class="hljs properties"> <span class="hljs-attr">a2enmod</span> <span class="hljs-string">php7.2</span> <span class="hljs-attr">systemctl</span> <span class="hljs-string">restart apache2</span> </pre> `<pre class="hljs properties">` `<span` `class="hljs-attr">a2enmod</span>` `<span` `class="hljs-string">php7.2</span>` `<span` `class="hljs-attr">systemctl</span>` `<span` class="hljs-string">restart `apache2</span>` `</pre>` "wallabag" highlights code in articles using highlight.js since version 2.3.3, many blogs and other help guides on the internet use it too. every line of text before the hightlight.js code is ok - everything after is not saved and "missing" The revisions are saved although no changes are saved - regardless of how often i try, the page stays empty. also i get a browser (firefox) error message when clicking save "are you sure you want to leave this page... ?" tested with BookStack version v0.29.0
OVERLORD added the 🐛 Bug📝 WYSIWYG Editor🔍 Pending Validation labels 2026-02-05 01:41:27 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jul 26, 2022):

Just ran a test on the latest release, by copying in a bunch of content from the highlightjs docs and homepage, in various different ways. Nothing prevented the content from being saved. I'm assuming this may be an issue now fixed or potentially something environment specific. I'll therefore close this off.

@ssddanbrown commented on GitHub (Jul 26, 2022): Just ran a test on the latest release, by copying in a bunch of content from the highlightjs docs and homepage, in various different ways. Nothing prevented the content from being saved. I'm assuming this may be an issue now fixed or potentially something environment specific. I'll therefore close this off.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1713