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