devilry / devilry-django

Devilry project main repository
http://devilry.org
BSD 3-Clause "New" or "Revised" License
51 stars 24 forks source link

`diffwrapper`'s tabs doesn't work for previews #1235

Closed torgeirl closed 2 years ago

torgeirl commented 2 years ago

It isn't possible to switch from Simple diff to Compact or side-by-side diff when previewing a comment. Switching works for the published comment.

Screenshot from 2022-08-12 12-58-13

espenak commented 2 years ago

This is documented in the documentation. image

It is not possible to preview this because of how the preview is rendered (it can not execute dynamic javascript). We CAN probably fix a message about this in the actual preview, but we can not make this work. The way to preview the different diff styles is to send the default style argument in the markdown. E.g.:

##<## compact
def Hello(self, x):
    print(f'Hello')
    print('World')
##>##
def hello(self, x):
    print(f'Hello {x}')
    print('World')
##<##

(default to compact mode, and that works in the preview)