Sublime Forum

Trying to syntax highlight HTML and Python in the same file. HTML syntax highlighting is not working

#1

Hi I’m using the PackageDev package and Sublime Text 4189 to create a custom syntax file which will syntax highlight both Python and HTML. However, the HTML is not being highlighted and renders as white, while the Python is correctly highlighted. I also tested it with text.html -> source.css or source.js and it seems to highlight those other languages correctly but not html.

%YAML 1.2
---
name: Test Python
file_extensions: [test]
scope: source.test
extends: Packages/Python/Python.sublime-syntax
version: 2

contexts:
  statements:
    - meta_prepend: true
    - match: '===='
      embed: scope:text.html
      escape: '----'
0 Likes

#2

Supposedly you want to use text.html.basic?

0 Likes