[TxMt] Troubles with regex and language grammar

Robert J. Rockefeller bob at bobrockefeller.com
Sun Nov 15 12:46:15 UTC 2015


I’m working on a bundle to add Markdown Extra to the stock Markdown language grammar with an injection. I have some of it working, but can’t seem to build the right regex to find the added classes syntax.

Here’s the Markdown Extra in question:

![Vagrant Logo](/images/icons/vagrant-logo.png){.image-right .image-33}When developing web sites on the Mac, we have a number of choices for serving the content and design we're working on.

I’m after the {.image-right .image-33} part and I’ve tried:

{	patterns = (
		{	name = 'source.yaml.front-matter';
			begin = '\A-{3}';
			end = '-{3}';
			patterns = ( { include = 'source.yaml'; } );
		},
		{	name = 'text.html.markdown.classes';
			begin = '\{';
			end = '\}';
		},
		{	name = 'markup.raw.block.markdown';
			begin = '^`{3}';
			end = '^`{3}';
		},
	);
}

and 

{	patterns = (
		{	name = 'source.yaml.front-matter';
			begin = '\A-{3}';
			end = '-{3}';
			patterns = ( { include = 'source.yaml'; } );
		},
		{	name = 'text.html.markdown.classes';
			begin = '\)\{';
			end = '\}';
		},
		{	name = 'markup.raw.block.markdown';
			begin = '^`{3}';
			end = '^`{3}';
		},
	);
}

What did I get wrong?

Bob
-------------------
Robert J. Rockefeller
Richmond Hill, GA
www.bobrockefeller.com



More information about the textmate mailing list