[TxMt] Re: how do I confine a begin-end pattern to within a single paragraph?
Tim Bates
timothy.c.bates at gmail.com
Mon Jan 20 12:03:04 UTC 2014
You will get a big head start by copying the markdown grammar for things like this… also has nice ruby scripts for reformatting
On 20 Jan 2014, at 8:49 AM, Allan Odgaard <mailinglist at textmate.org> wrote:
> On 20 Jan 2014, at 2:41, Matt Neuburg wrote:
>
>> repository = {
>> single_bold = {
>> name = 'markup.bold.asciidoc';
>> begin = '\*';
>> end = '\*';
>> };
>> };
>
> Adding to my previous reply, if a single asterisk is a user error (when not matched by a bullet list rule or bold) then another approach could be to do something like this:
>
> single_bold = {
> name = 'markup.bold.asciidoc';
> begin = '\*';
> end = '\*|(\n)';
> endCaptures = {
> 1 = { name = 'invalid.illegal.unterminated_asterisk.asciidoc'; };
> };
> };
>
> Here we terminate the rule either when seeing an asterisk or seeing a newline character, and in the latter case, we scope the newline as “invalid.illegal” which, with most themes, should give it a red background.
>
> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate
More information about the textmate
mailing list