quiz_master_next icon indicating copy to clipboard operation
quiz_master_next copied to clipboard

Line breaks removed into pre tags with code enlighter plugin

Open cedrick-f opened this issue 2 years ago • 0 comments

Hi

Site Info

WordPress Version: 6.3.1 QSM Version: 8.1.14 Browser: Firefox Plugin : Enlighter - Customizable Syntax Highlihter

General description

In question description, in <pre> tags, line breaks are removed after the question has been saved.

Steps to reproduce the behavior

In question description, create a little code in <pre> tag (in 'text' tab), for example :

<pre class="EnlighterJSRAW">
print("Hello")
print("world!")
</pre>

Click on "Save Question" Preview the quiz. The question appears like this : print("Hello") print("world!")

When edited in the 'Visual' tab, the code is automatically converted to raw html :

<pre class="EnlighterJSRAW">
print("Hello")</br>print("world!")
</pre>

then </br> appears when question is rendered.

Without using class="EnlighterJSRAW", it works, but there is no highlighting !

It would be great to be able to write code directly in the editor's 'text' mode by simply copying and pasting ...

thanks by advance

cedrick-f avatar Sep 03 '23 09:09 cedrick-f