main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
653 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | (function (Prism) {
|
---|
| 2 |
|
---|
| 3 | Prism.languages.erb = {
|
---|
| 4 | 'delimiter': {
|
---|
| 5 | pattern: /^(\s*)<%=?|%>(?=\s*$)/,
|
---|
| 6 | lookbehind: true,
|
---|
| 7 | alias: 'punctuation'
|
---|
| 8 | },
|
---|
| 9 | 'ruby': {
|
---|
| 10 | pattern: /\s*\S[\s\S]*/,
|
---|
| 11 | alias: 'language-ruby',
|
---|
| 12 | inside: Prism.languages.ruby
|
---|
| 13 | }
|
---|
| 14 | };
|
---|
| 15 |
|
---|
| 16 | Prism.hooks.add('before-tokenize', function (env) {
|
---|
| 17 | var erbPattern = /<%=?(?:[^\r\n]|[\r\n](?!=begin)|[\r\n]=begin\s(?:[^\r\n]|[\r\n](?!=end))*[\r\n]=end)+?%>/g;
|
---|
| 18 | Prism.languages['markup-templating'].buildPlaceholders(env, 'erb', erbPattern);
|
---|
| 19 | });
|
---|
| 20 |
|
---|
| 21 | Prism.hooks.add('after-tokenize', function (env) {
|
---|
| 22 | Prism.languages['markup-templating'].tokenizePlaceholders(env, 'erb');
|
---|
| 23 | });
|
---|
| 24 |
|
---|
| 25 | }(Prism));
|
---|
Note:
See
TracBrowser
for help on using the repository browser.