Hannah-Sten / TeXiFy-IDEA

LaTeX support for the IntelliJ platform by JetBrains.
https://hannah-sten.github.io/TeXiFy-IDEA
MIT License
882 stars 87 forks source link

Brace matching problems in \href #3613

Open Toseflo opened 1 month ago

Toseflo commented 1 month ago

Type of JetBrains IDE (IntelliJ, PyCharm, etc.) and version

IntelliJ IDEA Ultimate 2024.1.4

Operating System

Windows 11

TeXiFy IDEA version

0.9.7

What I did (steps to reproduce)

I wanted to add this bibmacro from stackexchange: https://tex.stackexchange.com/a/48409. IntelliJ gives me multiple warnings, but the code still works.

Minimal example to reproduce the problem

Simply add the following line somewhere.

\href{\thefield{url}}{#1}%

When you look at the brace matching, you notice that the opening bracket of \thefield{ is ignored and the closing bracket after url is treated as the closing bracket of href. This causes the second closing bracket to show an error.

PHPirates commented 1 month ago

Many thanks for reporting this, indeed { is not a valid character in a url so this is a brace counting issue in the parser