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:
781 bytes
|
Line | |
---|
1 | (function (Prism) {
|
---|
2 |
|
---|
3 | /**
|
---|
4 | * If the given language is present, it will insert the given doc comment grammar token into it.
|
---|
5 | *
|
---|
6 | * @param {string} lang
|
---|
7 | * @param {any} docComment
|
---|
8 | */
|
---|
9 | function insertDocComment(lang, docComment) {
|
---|
10 | if (Prism.languages[lang]) {
|
---|
11 | Prism.languages.insertBefore(lang, 'comment', {
|
---|
12 | 'doc-comment': docComment
|
---|
13 | });
|
---|
14 | }
|
---|
15 | }
|
---|
16 |
|
---|
17 | var tag = Prism.languages.markup.tag;
|
---|
18 |
|
---|
19 | var slashDocComment = {
|
---|
20 | pattern: /\/\/\/.*/,
|
---|
21 | greedy: true,
|
---|
22 | alias: 'comment',
|
---|
23 | inside: {
|
---|
24 | 'tag': tag
|
---|
25 | }
|
---|
26 | };
|
---|
27 | var tickDocComment = {
|
---|
28 | pattern: /'''.*/,
|
---|
29 | greedy: true,
|
---|
30 | alias: 'comment',
|
---|
31 | inside: {
|
---|
32 | 'tag': tag
|
---|
33 | }
|
---|
34 | };
|
---|
35 |
|
---|
36 | insertDocComment('csharp', slashDocComment);
|
---|
37 | insertDocComment('fsharp', slashDocComment);
|
---|
38 | insertDocComment('vbnet', tickDocComment);
|
---|
39 |
|
---|
40 | }(Prism));
|
---|
Note:
See
TracBrowser
for help on using the repository browser.