Sublime Forum

Adding custom highlighting to Markdown Editing Package

#1

Hi,

I use a lot of comments in my markdown documents using the following format: [//]: # (Comment Text). In MarkdownEditing, comments in this format are rendered attractively with a bright background colour- as long as they do not have line-breaks. I’d like to edit this so that line-breaks do not affect the background highlighting for these comments.

More explicitly, comments of this form are highlighted:
[//]: # (This is a comment without a line-break.)
While comments of this form are not:
[//]: # (This is a comment with a line-break.)
I’d like to change this so that the highlighting is not affected by line-breaks.

I used Package Resource Viewer and Color Scheme Editor to try and edit the colour scheme. But, I’m not sure how and what to edit in the .tmTheme xml file.

0 Likes

#2

looks like you’ll need to learn the tmLanguage file format and change this match regex pattern to a context that supports having the ) on a different line:

0 Likes

#3

Thanks for the reply.

Can you help me with how the new regex pattern should look like?

I was planning to add a new syntax component with the following regex: ‘\A[//]: # ((.*?))\z’, and then adding it in the theme file. Which method would be easier?

0 Likes