Skip to content

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

@reddexx

Description

@reddexx

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions