Rocket.Chat icon indicating copy to clipboard operation
Rocket.Chat copied to clipboard

Code blocks formats and escapes special characters

Open tarabanton opened this issue 9 years ago • 9 comments

Rocket.Chat Version: 0.54.2 Running Instances: 3 DB Replicaset OpLog: Enabled Node Version: 4.8.1

Code blocks formats and escapes cpecial characters etc. Affected, at least, quotes, ampersands, double quotes.

For example:

importScripts("https://www.gstatic.com/firebasejs/3.6.8/firebase-app.js?some=true&other=false");
importScripts("https://www.gstatic.com/firebasejs/3.6.8/firebase-messaging.js?some=true&other=false");

is converted to

importScripts("https://www.gstatic.com/firebasejs/3.6.8/firebase-app.js?some=true&other=false");
importScripts("https://www.gstatic.com/firebasejs/3.6.8/firebase-messaging.js?some=true&other=false");

tarabanton avatar Apr 05 '17 10:04 tarabanton

It seems, that this behavior is observed when code block start and\or end sequences``` code ``` are on the same line as code

tarabanton avatar Apr 05 '17 10:04 tarabanton

We having the same issue. One liner like this: ``` awk '{print $2}');

leads to --> screenshot. bildschirmfoto 2017-04-05 um 15 02 06

ghost avatar Apr 05 '17 13:04 ghost

This could be related to the implementation made to fix #6311 and changes made to the Regular Expression

gdelavald avatar Apr 05 '17 19:04 gdelavald

Same as #6592

gdelavald avatar Apr 08 '17 05:04 gdelavald

We get this too on 0.54.0, very annoying for developer teams.

razvanphp avatar Apr 10 '17 08:04 razvanphp

"Bug" still in 0.56.0.

ghost avatar May 18 '17 08:05 ghost

I've had this issue, but only if the code block isn't closed correctly. If I leave off the closing ``` then the characters are turned into ampersand character codes, but if the block is closed correctly, the characters remain.

screenshot 2017-05-30 10 44 46

rabidang3ls avatar May 30 '17 16:05 rabidang3ls

Same as #6789

martinvonwittich avatar Jul 05 '17 12:07 martinvonwittich

Seems to be fixed with 0.57.0 here.

ghost avatar Jul 06 '17 13:07 ghost