[Code-Block/SQL] Escape of character ' #3426

Closed
opened 2026-02-05 06:40:49 +03:00 by OVERLORD · 1 comment
Owner

Originally created by @reddexx on GitHub (Jan 3, 2023).

Describe the Bug

Escape of character '

Generally it should be [' ']. Only in in MySQL and PostgreSQL ['] escapes it.

Works in MSSQL + Oracle:

update FileConnection set ServerPath = REPLACE(ServerPath, '\edi\','\edi_test\') where ConnectName = 'EDI';

In Bookstack it destroys the coloring

CodeMirror Give me this:

import {basicSetup, EditorView} from "codemirror"
import {sql, MSSQL} from "@codemirror/lang-sql"

new EditorView({
 doc: "update FileConnection set ServerPath = REPLACE(ServerPath, '\edi\','\edi_test\') where ConnectName = 'EDI';",
 extensions: [basicSetup, sql({dialect: MSSQL})],
 parent: document.body
})

Steps to Reproduce

CodeMirrors Code-Block

SQL-Code

update FileConnection set ServerPath = REPLACE(ServerPath, '\edi\','\edi_test\') where ConnectName = 'EDI';

Expected Behaviour

There are several SQL Server products and with other logic, please do for example:
SQL (MYSQL/PostgreSQL) With the right highlighting
SQL (ORACLE/MSSQL) With the right highlighting

Screenshots or Additional Context

No response

Browser Details

all Browser

Exact BookStack Version

22.11.1

PHP Version

8.1

Hosting Environment

Docker

Originally created by @reddexx on GitHub (Jan 3, 2023). ### Describe the Bug Escape of character ' Generally it should be [' ']. Only in in MySQL and PostgreSQL [\'] escapes it. Works in MSSQL + Oracle: ``` update FileConnection set ServerPath = REPLACE(ServerPath, '\edi\','\edi_test\') where ConnectName = 'EDI'; ``` In Bookstack it destroys the coloring CodeMirror Give me this: ``` import {basicSetup, EditorView} from "codemirror" import {sql, MSSQL} from "@codemirror/lang-sql" new EditorView({ doc: "update FileConnection set ServerPath = REPLACE(ServerPath, '\edi\','\edi_test\') where ConnectName = 'EDI';", extensions: [basicSetup, sql({dialect: MSSQL})], parent: document.body }) ``` ### Steps to Reproduce CodeMirrors Code-Block SQL-Code ``` update FileConnection set ServerPath = REPLACE(ServerPath, '\edi\','\edi_test\') where ConnectName = 'EDI'; ``` ### Expected Behaviour There are several SQL Server products and with other logic, please do for example: SQL (MYSQL/PostgreSQL) With the right highlighting SQL (ORACLE/MSSQL) With the right highlighting ### Screenshots or Additional Context _No response_ ### Browser Details all Browser ### Exact BookStack Version 22.11.1 ### PHP Version 8.1 ### Hosting Environment Docker
OVERLORD added the 🐛 Bug label 2026-02-05 06:40:49 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jan 26, 2023):

Support for a range of common sql dialects now added in 25bdd71477, will be part of the next feature release.

@ssddanbrown commented on GitHub (Jan 26, 2023): Support for a range of common sql dialects now added in 25bdd714771a269d369e1702d2b6d2e6becbaf02, will be part of the next feature release.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3426