Sublime Forum

[Problem Solved] Bracket highlighting for an extended html syntax

#1

I use the following syntax for an html file that contains both HTML and Latex:


%YAML 1.2

name: HTML (Mathjax)
scope: text.html.mathjax

file_extensions:

  • html
  • htm
  • shtml
  • xhtml

contexts:
main:
- include: scope:text.tex.latex
- include: scope:text.html.basic


Using this syntax I am able to color highlight both the HTML and the Latex. However, I have not been able to get the BracketHighlighter package to work with this syntax, Does anyone have any suggestions?

0 Likes

#2

I would guess you can tackle it after reading brackethighlighter’s settings. I guess it’s just a copy and do some tiny modification thing.

0 Likes

#3

Bracket Highligher works for all of the syntaxes except for the one I’ve added: HTML (Mathjax). I’ve tried obvious things like adding HTML (Mathjax) to the list of syntaxes under html tag_mode in bh-tag.sublime-settings and to the list of languages under angle brackets in bh_core.sublime-settings. I’m beginning to think that I may need to modify my added syntax.

0 Likes

#4

[Problem Solved] what I was trying to do before was correct, I just didn’t implement it correctly. I added my syntax to the list of syntaxes for angle in user core settings using user_brackets. This worked correctly. I tried a similar approach in the tag settings, adding my syntax to the list of syntaxes under html mode using user_tag_modes. It turns out that you can’t use this user shortcut in the tag settings, I needed to add the entirety of tag_modes to user settings and then add my syntax under html mode. When I changed the settings correctly, brackethighlighter worked correctly.

0 Likes