2011.2.11
「TextMateで全角スペースと半角スペースの区別ができるようにする : アシアルブログ」の手順3〜4を施したコードのメモです。
{ scopeName = 'text.html.basic';
firstLineMatch = '
|)$
|(?:php)?.*b(if|for(each)?|while)b.+:
|{{?(if|foreach|capture|literal|foreach|php|section|strip)
|{s*($|?>s*$|//|/*(.**/s*$|(?!.*?*/)))
)';
foldingStopMarker = '(?x)
((?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|li|form|dl)>
|^(?!.*?$
|(?:php)?.*bend(if|for(each)?|while)b
|{{?/(if|foreach|capture|literal|foreach|php|section|strip)
|^[^{]*}
)';
patterns = (
{ include = '#whitespace-multi'; },
{ name = 'meta.tag.any.html';
begin = '(<)([a-zA-Z0-9:]++)(?=[^>]*>2>)';
end = '(>(<)/)(2)(>)';
beginCaptures = {
1 = { name = 'punctuation.definition.tag.html'; };
2 = { name = 'entity.name.tag.html'; };
};
endCaptures = {
1 = { name = 'punctuation.definition.tag.html'; };
2 = { name = 'meta.scope.between-tag-pair.html'; };
3 = { name = 'entity.name.tag.html'; };
4 = { name = 'punctuation.definition.tag.html'; };
};
patterns = ( { include = '#tag-stuff'; } );
},
{ name = 'meta.tag.preprocessor.xml.html';
begin = '()(xml)';
end = '(?>)';
captures = {
1 = { name = 'punctuation.definition.tag.html'; };
2 = { name = 'entity.name.tag.xml.html'; };
};
patterns = (
{ include = '#tag-generic-attribute'; },
{ include = '#string-double-quoted'; },
{ include = '#string-single-quoted'; },
);
},
{ name = 'comment.block.html';
begin = '
の直前に記述するのがいいらしい