SQL Syntax Highlighting

Steps to reproduce

  • Create new file
  • Insert a SQL code block as below
declare a_variable varchar(10) = 'E:\'

select a_variable
  • Note that syntax highlighting fails after the backslash

Did you follow the troubleshooting guide?

Y (confirmed in Sandbox vault)

Expected result

Correct syntax highlighting (T-SQL does not use a backslash as an escape symbol)

Actual result

Incorrect syntax highlighting

Environment

(Sandbox)
SYSTEM INFO:
Obsidian version: v1.3.4
Installer version: v1.1.16
Operating system: Windows 10 Enterprise 10.0.22621
Login status: not logged in
Insider build toggle: off
Live preview: on
Legacy editor: off
Base theme: dark
Community theme: none
Snippets enabled: 0
Restricted mode: on

RECOMMENDATIONS:
none


Additional information

Is this in editing view or reading view? Syntax highlighting is different between the views.

It fails differently in both Editing and Reading mode. In Edit mode it formats the rest of the file as a string. In Reading mode it only formats part of the file as a string and then (for no reason that I can see) switches back to proper syntax highlighting.

we use different parsers. Nothing we can do about it, just wait for the upstream fix.

In terms of the upstream fix, is that something I can follow up on and report to the upstream developers?
I’m happy to go report the bug wherever necessary.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.