Replies: 2 comments 1 reply
-
|
No, sorry, I cannot think of a way to support nested embeddings like that :( The end rule would be dependent on data the start rule captures, and accurately keeping track of that information may not be possible since Textadept invokes the lexer in chunks of code, not the entire document at once. You might get correct highlighting when opening the document for the first time, but as you edit it, things would probably get out of sync. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for the answer, and sorry for the delayed response, I had a busy weekend... This is not a great problem. Nested math environments are not so common, and I will simply avoid to use them - and, by the way, with those 5 lines of code of mine added to the Markdown lexer Textadept in this aspect is still better than 99% of the text editors in existence. I will still use this thread to suggest a couple of ideas for future official Textadept releases:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone. For academic reasons, I need to use LaTeX math syntax in Markdown documents, which are then processed with Pandoc. Almost no text editor provides syntax highlighting for LaTeX math inside
.mdfiles, but some time ago I managed to add initial support for this feature in Textadept by copying themarkdown.lualexer in my local configuration folder and adding the following code at the end of the file:This works fine in most cases, with Textadept correctly highlighting both inline and display math... But, as I recently found, does not work completely when nesting multiple LaTeX display math environments: for example, when nesting multiple
alignblocks inside agatherblock, the result looks like this:As you can see, the
\\commands after the\end{align*}ones and the entire formula right before the\end{gather*}command are not highlighted. It should have been easy to see this limit, but when I first implemented this solution I was on a rush and I didn't think much on it. Is there a way to improve my solution and to support such cases?Thank you in advance. By the way, nowadays various people use LaTeX math inside Markdown documents; it would be nice to support for this particular syntax in the default Markdown lexer of Textadept.
Beta Was this translation helpful? Give feedback.
All reactions