Code Blocks are not getting wrapped in revision diffs #717

Closed
opened 2026-02-04 22:02:14 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @watschi on GitHub (Jun 15, 2018).

  • BookStack Version (Found in settings, Please don't put 'latest'): v0.22.0
  • PHP Version: PHP 7.0.30-0ubuntu0.16.04.1
  • MySQL Version: mysql Ver 15.1 Distrib 10.0.34-MariaDB, for debian-linux-gnu (x86_64)
Expected Behavior

When viewing diffs of different site revisions code blocks should get wrapped

Current Behavior

Code blocks don't get rendered correctly when viewing a diff

Steps to Reproduce

Change something in a code block an view the changes in revision history

page_view

revision_diff

Originally created by @watschi on GitHub (Jun 15, 2018). * BookStack Version *(Found in settings, Please don't put 'latest')*: v0.22.0 * PHP Version: PHP 7.0.30-0ubuntu0.16.04.1 * MySQL Version: mysql Ver 15.1 Distrib 10.0.34-MariaDB, for debian-linux-gnu (x86_64) ##### Expected Behavior When viewing diffs of different site revisions code blocks should get wrapped ##### Current Behavior Code blocks don't get rendered correctly when viewing a diff ##### Steps to Reproduce Change something in a code block an view the changes in revision history ![page_view](https://user-images.githubusercontent.com/26351931/41453139-dbf34a08-7074-11e8-8315-b41eae28b3d5.png) ![revision_diff](https://user-images.githubusercontent.com/26351931/41453144-df0b5f3c-7074-11e8-995e-6e68733cc550.png)
OVERLORD added the 🐛 Bug label 2026-02-04 22:02:14 +03:00
Author
Owner

@Abijeet commented on GitHub (Jun 17, 2018):

Can reproduce on demo. I think codemirror is not being initialized on revision pages.

@Abijeet commented on GitHub (Jun 17, 2018): Can reproduce on demo. I think codemirror is not being initialized on revision pages.
Author
Owner

@ssddanbrown commented on GitHub (Jun 17, 2018):

Yeah, Codemirror instances won't run on diffs but I don't think they should in that case since it'll remove any diff highlighting which I'd consider more important in this view.

I think instead we just need to add styling to wrap these on diffs. I think we already do this for exports.

@ssddanbrown commented on GitHub (Jun 17, 2018): Yeah, Codemirror instances won't run on diffs but I don't think they should in that case since it'll remove any diff highlighting which I'd consider more important in this view. I think instead we just need to add styling to wrap these on diffs. I think we already do this for exports.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#717