PROBLEM: Smart quotes introduced in board conversion

@krisjanis

It seems that - for some reason - "plain" double quotes " have been replaced by smart or however different quotes ”” in the old board posts.
This makes copying and paste code snippets a problem.

When writing on the board, the first quote you type (SHIFT+2) is a “plain” one, but when you type a second closing one after they both sometimes change to the “other” kind.
ASCII 0x93 Left double quotation mark (Unicode U+201C)
and
ASCII 0x94 Right double quotation mark (Unicode U+201D)
instead of the plain
ASCII 0x22 Double quotes (or speech marks) (Unicode U+0022)

Even worse when you write a post (on the left) and you enter the 0x22’s, they actually appear as (and are) a 0x22, only on the preview on the right they become 0x93 and 0x94.

When typing inside a three backticks RouterOS CODE block:

"comment"

or in a generic four backticks text block this seemingly doesn’t happen (thank goodness).

But it happens way too often that code/configurations/snippets are posted outside the CODE tags, so there is the potentiality to make a mess.

IF possible:

  1. this “smart” feature noone asked for should be disabled
  2. in the board database 0x93’s and 0x94’s should be replaced by 0x22’s.

I verified copying and pasting the following in a hex editor, twice, once “text” and once “unicode”:

Obtaining:

And HTML is even worse:

<!--StartFragment--><code>"plain_quotes"</code><br>
“smart_quotes”<!--EndFragment-->
1 Like

I think this is only the “rendering engine” that also handles the markdown formatting. In the database where the textual content is stored, you still have the original double quote character. If you edit the post and add the backticks around the content, you’ll see that the original is still there.

Whatever.

If you copy and paste a code snippet (not on a post of yours) you obtain different data copied and you will have issues pasting them.

In new posts the “inside CODE block” double quotes are preserved, but in the conversion they are also present inside them in old posts. ← this is the biggest issue.

Then, since some members INSTEAD of using CODE blocks post code in plain text or inside QUOTE tags because this way they can highlight/colour/bold/underline the most relevant part, their suggested code cannot be copied and pasted for further editing in - say - Notepad without carrying with them the “smart quotes”.

Exactly, they’re correct in the database, it’s Discourse that changes them on-the-fly in the HTML…
I have to correct the thousands of old posts about this… including [code2]xxx[/code2] who has been completely debunked.

Should be disabled now, I think. Please check.

1 Like
"plain_quotes"

"smart_quotes"

0D 0A 22 70 6C 61 69 6E 5F 71 75 6F 74 65 73 22
0D 0A 22 73 6D 61 72 74 5F 71 75 6F 74 65 73 22
0D 0A

0D 0A 22 00 70 00 6C 00 61 00 69 00 6E 00 5F 00
71 00 75 00 6F 00 74 00 65 00 73 00 22 00 0D 00
0A 00 0D 00 0A 00 22 00 73 00 6D 00 61 00 72 00
74 00 5F 00 71 00 75 00 6F 00 74 00 65 00 73 00
22 00

Good for me, thanks. :smile: