Guest User

Untitled

a guest
Jan 22nd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.96 KB | None | 0 0
  1. { scopeName = 'text.html.basic';
  2. firstLineMatch = '<!DOCTYPE|<(?i:html)|<\?(?i:php)';
  3. fileTypes = ( 'html', 'htm', 'shtml', 'xhtml', 'phtml', 'php', 'inc', 'tmpl', 'tpl', 'ctp' );
  4. foldingStartMarker = '(?x)
  5. (<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|li|form|dl)\b.*?>
  6. |<!--(?!.*--\s*>)
  7. |^<!--\ \#tminclude\ (?>.*?-->)$
  8. |<\?(?:php)?.*\b(if|for(each)?|while)\b.+:
  9. |\{\{?(if|foreach|capture|literal|foreach|php|section|strip)
  10. |\{\s*($|\?>\s*$|//|/\*(.*\*/\s*$|(?!.*?\*/)))
  11. |array\s?\(\s*$
  12. )';
  13. foldingStopMarker = '(?x)
  14. (</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|li|form|dl)>
  15. |^(?!.*?<!--).*?--\s*>
  16. |^<!--\ end\ tminclude\ -->$
  17. |<\?(?:php)?.*\bend(if|for(each)?|while)\b
  18. |\{\{?/(if|foreach|capture|literal|foreach|php|section|strip)
  19. |^[^{]*\}
  20. |^\s*\),
  21. )';
  22. patterns = (
  23. { name = 'meta.tag.any.html';
  24. begin = '(<)([a-zA-Z0-9:]++)(?=[^>]*></\2>)';
  25. end = '(>(<)/)(\2)(>)';
  26. beginCaptures = {
  27. 1 = { name = 'punctuation.definition.tag.html'; };
  28. 2 = { name = 'entity.name.tag.html'; };
  29. };
  30. endCaptures = {
  31. 1 = { name = 'punctuation.definition.tag.html'; };
  32. 2 = { name = 'meta.scope.between-tag-pair.html'; };
  33. 3 = { name = 'entity.name.tag.html'; };
  34. 4 = { name = 'punctuation.definition.tag.html'; };
  35. };
  36. patterns = ( { include = '#tag-stuff'; } );
  37. },
  38. { name = 'meta.tag.preprocessor.xml.html';
  39. begin = '(<\?)(xml)';
  40. end = '(\?>)';
  41. captures = {
  42. 1 = { name = 'punctuation.definition.tag.html'; };
  43. 2 = { name = 'entity.name.tag.xml.html'; };
  44. };
  45. patterns = (
  46. { include = '#tag-generic-attribute'; },
  47. { include = '#string-double-quoted'; },
  48. { include = '#string-single-quoted'; },
  49. );
  50. },
  51. { name = 'comment.block.html';
  52. begin = '<!--';
  53. end = '--\s*>';
  54. captures = { 0 = { name = 'punctuation.definition.comment.html'; }; };
  55. patterns = (
  56. { name = 'invalid.illegal.bad-comments-or-CDATA.html';
  57. match = '--';
  58. },
  59. { include = '#embedded-code'; },
  60. );
  61. },
  62. { name = 'meta.tag.sgml.html';
  63. begin = '<!';
  64. end = '>';
  65. captures = { 0 = { name = 'punctuation.definition.tag.html'; }; };
  66. patterns = (
  67. { name = 'meta.tag.sgml.doctype.html';
  68. begin = '(DOCTYPE)';
  69. end = '(?=>)';
  70. captures = { 1 = { name = 'entity.name.tag.doctype.html'; }; };
  71. patterns = (
  72. { name = 'string.quoted.double.doctype.identifiers-and-DTDs.html';
  73. match = '"[^">]*"';
  74. },
  75. );
  76. },
  77. { name = 'constant.other.inline-data.html';
  78. begin = '\[CDATA\[';
  79. end = ']](?=>)';
  80. },
  81. { name = 'invalid.illegal.bad-comments-or-CDATA.html';
  82. match = '(\s*)(?!--|>)\S(\s*)';
  83. },
  84. );
  85. },
  86. { include = '#embedded-code'; },
  87. { name = 'source.css.embedded.html';
  88. begin = '(?:^\s+)?(<)((?i:style))\b(?![^>]*/>)';
  89. end = '(</)((?i:style))(>)(?:\s*\n)?';
  90. captures = {
  91. 1 = { name = 'punctuation.definition.tag.html'; };
  92. 2 = { name = 'entity.name.tag.style.html'; };
  93. 3 = { name = 'punctuation.definition.tag.html'; };
  94. };
  95. patterns = (
  96. { include = '#tag-stuff'; },
  97. { begin = '(>)';
  98. end = '(?=</(?i:style))';
  99. beginCaptures = { 1 = { name = 'punctuation.definition.tag.html'; }; };
  100. patterns = (
  101. { include = '#embedded-code'; },
  102. { include = 'source.css'; },
  103. );
  104. },
  105. );
  106. },
  107. { name = 'source.js.embedded.html';
  108. begin = '(?:^\s+)?(<)((?i:script))\b(?![^>]*/>)';
  109. end = '(?<=</(script|SCRIPT))(>)(?:\s*\n)?';
  110. beginCaptures = {
  111. 1 = { name = 'punctuation.definition.tag.html'; };
  112. 2 = { name = 'entity.name.tag.script.html'; };
  113. };
  114. endCaptures = { 2 = { name = 'punctuation.definition.tag.html'; }; };
  115. patterns = (
  116. { include = '#tag-stuff'; },
  117. { begin = '(?<!</(?:script|SCRIPT))(>)';
  118. end = '(</)((?i:script))';
  119. captures = {
  120. 1 = { name = 'punctuation.definition.tag.html'; };
  121. 2 = { name = 'entity.name.tag.script.html'; };
  122. };
  123. patterns = (
  124. { name = 'comment.line.double-slash.js';
  125. match = '(//).*?((?=</script)|$\n?)';
  126. captures = { 1 = { name = 'punctuation.definition.comment.js'; }; };
  127. },
  128. { name = 'comment.block.js';
  129. begin = '/\*';
  130. end = '\*/|(?=</script)';
  131. captures = { 0 = { name = 'punctuation.definition.comment.js'; }; };
  132. },
  133. { include = '#php'; },
  134. { include = 'source.js'; },
  135. );
  136. },
  137. );
  138. },
  139. { name = 'meta.tag.structure.any.html';
  140. begin = '(</?)((?i:body|head|html)\b)';
  141. end = '(>)';
  142. captures = {
  143. 1 = { name = 'punctuation.definition.tag.html'; };
  144. 2 = { name = 'entity.name.tag.structure.any.html'; };
  145. };
  146. patterns = ( { include = '#tag-stuff'; } );
  147. },
  148. { name = 'meta.tag.block.any.html';
  149. begin = '(</?)((?i:address|blockquote|dd|div|dl|dt|fieldset|form|frame|frameset|h1|h2|h3|h4|h5|h6|iframe|noframes|object|ol|p|ul|applet|center|dir|hr|menu|pre)\b)';
  150. end = '(>)';
  151. beginCaptures = {
  152. 1 = { name = 'punctuation.definition.tag.begin.html'; };
  153. 2 = { name = 'entity.name.tag.block.any.html'; };
  154. };
  155. endCaptures = { 1 = { name = 'punctuation.definition.tag.end.html'; }; };
  156. patterns = ( { include = '#tag-stuff'; } );
  157. },
  158. { name = 'meta.tag.inline.any.html';
  159. begin = '(</?)((?i:a|abbr|acronym|area|b|base|basefont|bdo|big|br|button|caption|cite|code|col|colgroup|del|dfn|em|font|head|html|i|img|input|ins|isindex|kbd|label|legend|li|link|map|meta|noscript|optgroup|option|param|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|var)\b)';
  160. end = '((?: ?/)?>)';
  161. beginCaptures = {
  162. 1 = { name = 'punctuation.definition.tag.begin.html'; };
  163. 2 = { name = 'entity.name.tag.inline.any.html'; };
  164. };
  165. endCaptures = { 1 = { name = 'punctuation.definition.tag.end.html'; }; };
  166. patterns = ( { include = '#tag-stuff'; } );
  167. },
  168. { name = 'meta.tag.other.html';
  169. begin = '(</?)([a-zA-Z0-9:]+)';
  170. end = '(>)';
  171. beginCaptures = {
  172. 1 = { name = 'punctuation.definition.tag.begin.html'; };
  173. 2 = { name = 'entity.name.tag.other.html'; };
  174. };
  175. endCaptures = { 1 = { name = 'punctuation.definition.tag.end.html'; }; };
  176. patterns = ( { include = '#tag-stuff'; } );
  177. },
  178. { include = '#entities'; },
  179. { name = 'invalid.illegal.incomplete.html';
  180. match = '<>';
  181. },
  182. { name = 'invalid.illegal.bad-angle-bracket.html';
  183. match = '<';
  184. },
  185. );
  186. repository = {
  187. embedded-code = {
  188. patterns = (
  189. { include = '#ruby'; },
  190. { include = '#php'; },
  191. { include = '#smarty'; },
  192. { include = '#python'; },
  193. );
  194. };
  195. entities = {
  196. patterns = (
  197. { name = 'constant.character.entity.html';
  198. match = '(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)';
  199. captures = {
  200. 1 = { name = 'punctuation.definition.entity.html'; };
  201. 3 = { name = 'punctuation.definition.entity.html'; };
  202. };
  203. },
  204. { name = 'invalid.illegal.bad-ampersand.html';
  205. match = '&';
  206. },
  207. );
  208. };
  209. php = {
  210. begin = '(?=(^\s*)?<\?)';
  211. end = '(?!(^\s*)?<\?)';
  212. patterns = ( { include = 'source.php'; } );
  213. };
  214. python = {
  215. name = 'source.python.embedded.html';
  216. begin = '(?:^\s*)<\?python(?!.*\?>)';
  217. end = '\?>(?:\s*$\n)?';
  218. patterns = ( { include = 'source.python'; } );
  219. };
  220. ruby = {
  221. patterns = (
  222. { name = 'comment.block.erb';
  223. begin = '<%+#';
  224. end = '%>';
  225. captures = { 0 = { name = 'punctuation.definition.comment.erb'; }; };
  226. },
  227. { name = 'source.ruby.embedded.html';
  228. begin = '<%+(?!>)=?';
  229. end = '-?%>';
  230. captures = { 0 = { name = 'punctuation.section.embedded.ruby'; }; };
  231. patterns = (
  232. { name = 'comment.line.number-sign.ruby';
  233. match = '(#).*?(?=-?%>)';
  234. captures = { 1 = { name = 'punctuation.definition.comment.ruby'; }; };
  235. },
  236. { include = 'source.ruby'; },
  237. );
  238. },
  239. { name = 'source.ruby.nitro.embedded.html';
  240. begin = '<\?r(?!>)=?';
  241. end = '-?\?>';
  242. captures = { 0 = { name = 'punctuation.section.embedded.ruby.nitro'; }; };
  243. patterns = (
  244. { name = 'comment.line.number-sign.ruby.nitro';
  245. match = '(#).*?(?=-?\?>)';
  246. captures = { 1 = { name = 'punctuation.definition.comment.ruby.nitro'; }; };
  247. },
  248. { include = 'source.ruby'; },
  249. );
  250. },
  251. );
  252. };
  253. smarty = {
  254. patterns = (
  255. { begin = '(\{(literal)\})';
  256. end = '(\{/(literal)\})';
  257. captures = {
  258. 1 = { name = 'source.smarty.embedded.html'; };
  259. 2 = { name = 'support.function.built-in.smarty'; };
  260. };
  261. },
  262. { name = 'source.smarty.embedded.html';
  263. begin = '{{|{';
  264. end = '}}|}';
  265. patterns = ( { include = 'source.smarty'; } );
  266. disabled = 1;
  267. },
  268. );
  269. };
  270. string-double-quoted = {
  271. name = 'string.quoted.double.html';
  272. begin = '"';
  273. end = '"';
  274. beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.html'; }; };
  275. endCaptures = { 0 = { name = 'punctuation.definition.string.end.html'; }; };
  276. patterns = (
  277. { include = '#embedded-code'; },
  278. { include = '#entities'; },
  279. );
  280. };
  281. string-single-quoted = {
  282. name = 'string.quoted.single.html';
  283. begin = "'";
  284. end = "'";
  285. beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.html'; }; };
  286. endCaptures = { 0 = { name = 'punctuation.definition.string.end.html'; }; };
  287. patterns = (
  288. { include = '#embedded-code'; },
  289. { include = '#entities'; },
  290. );
  291. };
  292. tag-generic-attribute = {
  293. name = 'entity.other.attribute-name.html';
  294. match = '\b([a-zA-Z\-:]+)';
  295. };
  296. tag-id-attribute = {
  297. name = 'meta.attribute-with-value.id.html';
  298. begin = '\b(id)\b\s*(=)';
  299. end = '(?<=''|")';
  300. captures = {
  301. 1 = { name = 'entity.other.attribute-name.id.html'; };
  302. 2 = { name = 'punctuation.separator.key-value.html'; };
  303. };
  304. patterns = (
  305. { name = 'string.quoted.double.html';
  306. contentName = 'meta.toc-list.id.html';
  307. begin = '"';
  308. end = '"';
  309. beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.html'; }; };
  310. endCaptures = { 0 = { name = 'punctuation.definition.string.end.html'; }; };
  311. patterns = (
  312. { include = '#embedded-code'; },
  313. { include = '#entities'; },
  314. );
  315. },
  316. { name = 'string.quoted.single.html';
  317. contentName = 'meta.toc-list.id.html';
  318. begin = "'";
  319. end = "'";
  320. beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.html'; }; };
  321. endCaptures = { 0 = { name = 'punctuation.definition.string.end.html'; }; };
  322. patterns = (
  323. { include = '#embedded-code'; },
  324. { include = '#entities'; },
  325. );
  326. },
  327. );
  328. };
  329. tag-stuff = {
  330. patterns = (
  331. { include = '#tag-id-attribute'; },
  332. { include = '#tag-generic-attribute'; },
  333. { include = '#string-double-quoted'; },
  334. { include = '#string-single-quoted'; },
  335. { include = '#embedded-code'; },
  336. );
  337. };
  338. };
  339. }
Add Comment
Please, Sign In to add comment