candycane icon indicating copy to clipboard operation
candycane copied to clipboard

Quotes in <code> tags are replaces by curly quotes, breaking compatibility with SQL codes.

Open fabianofa opened this issue 9 years ago • 3 comments

If a user updates a issue using <code> (some SQL with quotes) </code>, simple quotes will be replaced with curly quotes which if directly pasted to a Database Manager like MySQL Workbench will alert erros for bad syntax.

screenshot_1 screenshot_2

fabianofa avatar Dec 18 '15 21:12 fabianofa

@fabianofa could you give an example comment which break SQL?

yandod avatar Dec 25 '15 04:12 yandod

The example is shown on the first image. The second screenshot is the text written inside the <textarea> input when an user click to update an issue.

Transcribing the images:

The SQL written while editing:

CREATE TABLE payment_methods (
  id INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '',
  description VARCHAR(45) NOT NULL COMMENT '',
  status TINYINT(1) NULL DEFAULT 1 COMMENT '',
  PRIMARY KEY (id)  COMMENT ''
);

The SQL how is shown after clicking on save:

CREATE TABLE payment_methods ( id INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT ‘’, description VARCHAR(45) NOT NULL COMMENT ‘’, status TINYINT(1) NULL DEFAULT 1 COMMENT ‘’, PRIMARY KEY (id) COMMENT ‘’ );

Also, may I suggest the syntax highlight lib https://highlightjs.org/ ? It allows users to set a class= attribute in <code> tags, such as sql so the content inside <code class="sql"> would have color highlight.

fabianofa avatar Dec 28 '15 13:12 fabianofa

I now understand what is happening.

copy and paste SQL into some database tool from ticket is not primary concern of candycane. notes of ticket can note detect which text is sql or not.

yandod avatar Dec 29 '15 06:12 yandod