jlelong / vscode-latex-basics

LaTeX grammars for Visual Studio Code
MIT License
19 stars 10 forks source link

Incorrect syntax highlighting for command \hyperref[]{} #69

Closed NemoYuan2008 closed 11 months ago

NemoYuan2008 commented 1 year ago

This issue is similar as https://github.com/jlelong/vscode-latex-basics/issues/67 .

The syntax highlighting of command \hyperref[]{} is incorrect, if a math equation with braces is used in the reference text. A minimal example:

\documentclass{article}
\usepackage{hyperref}

\begin{document}

\section{My Section}\label{sec:my}

Hello, \hyperref[sec:my]{$\mathbf{sec}$}, 
the rest of document is incorrectly highlighted as math.

\end{document}

image

I have checked that it still happens with the development version.