Search code examples
markdownsublimetext3

Sublime Text syntax highlighting issue with Liquid filters in markdown


I'm using Sublime Text 3 (v3.2.2) to write markdown files for a Jekyll website. Since the website is hosted on GitHub I must use the relative_url filter to properly set file paths (see https://jekyllrb.com/docs/liquid/filters/). I am using the default Mariana color scheme in Sublime Text but it doesn't work well with Liquid filters used by Jekyll in markdown files.

Here's an image of the syntax highlighting issue:

screen1

And here is an image if I remove the Liquid filter:

screen2

Is there a way to edit the default Mariana color scheme to properly handle the Liquid filters in markdown files?


Solution

  • I'm posting this solution as it removed the need for using Liquid syntax in the Markdown files. As a work-around, this fixes the syntax highlighting issue.

    Since the project website is hosted in a GitHub repo that is not a user or organization repo, the baseurl can be set to the repository name such as baseurl: /swift-macos in the Jekyll _config.yml file. Therefore, paths in the HTML and Markdown files must start with /swift-macos. This offers an alternative to using the relative_url filter.