Skip to content

(SQL) Escaped quotes breaks highlight #4269

Closed
@angeljqv

Description

@angeljqv

Describe the issue

Queries with escaped values breaks highlight
Image

but the query is correct and works in the DB.
Image

Which language seems to have the issue?
SQL

Are you using highlight or highlightAuto?

hljs.highlight(my_code, {language: 'sql'})

Sample Code to Reproduce and Expected behavior
https://highlightjs.org/demo#lang=sql&v=1&theme=atom-one-dark&code=c2VsZWN

select 'text"' as `field`; --' work
select 'text\'' as `field`; --'  dont work in highlightjs but works here and on other plugins
select 'text\\'' as `field`; --'  --also try
select 'text\\' as `field`; --'  double backslash is only one on run
select 'text\' as `field`; --'  --this must fail, it's ok

Why


Image

Must be:
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions