Skip to content

(LaTeX) Matching TeX magic comments should be case insensitive #3243

@PhelypeOleinik

Description

@PhelypeOleinik

Describe the issue

TeX magic comments are, in most editors, case insensitive, so both lines below are interpreted:

% !TeX program = lualatex
% !TEX encoding = UTF-8
%   ^ note e vs. E here

but the MAGIC_COMMENT rule only highlights the TeX (first) line:

const MAGIC_COMMENT = {
className: 'meta',
begin: '% !TeX',
end: '$',
relevance: 10
};

Screenshot from 2021-06-14 11-30-00

Which language seems to have the issue?

latex

Are you using highlight or highlightAuto?

I don't know? highlight I think because the language is specified explicitly.

Sample Code to Reproduce

% !TeX program = lualatex
% !TEX encoding = UTF-8
%   ^ note e vs. E here

Expected behavior

In the sample above, lines 1 and 2 should be highlighted as MAGIC_COMMENT, and line 3 should be a regular COMMENT:

Screenshot from 2021-06-14 11-32-46

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