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:
883 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | 'use strict'
|
---|
| 2 |
|
---|
| 3 | module.exports = bbcode
|
---|
| 4 | bbcode.displayName = 'bbcode'
|
---|
| 5 | bbcode.aliases = ['shortcode']
|
---|
| 6 | function bbcode(Prism) {
|
---|
| 7 | Prism.languages.bbcode = {
|
---|
| 8 | tag: {
|
---|
| 9 | pattern:
|
---|
| 10 | /\[\/?[^\s=\]]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+))?(?:\s+[^\s=\]]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+))*\s*\]/,
|
---|
| 11 | inside: {
|
---|
| 12 | tag: {
|
---|
| 13 | pattern: /^\[\/?[^\s=\]]+/,
|
---|
| 14 | inside: {
|
---|
| 15 | punctuation: /^\[\/?/
|
---|
| 16 | }
|
---|
| 17 | },
|
---|
| 18 | 'attr-value': {
|
---|
| 19 | pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+)/,
|
---|
| 20 | inside: {
|
---|
| 21 | punctuation: [
|
---|
| 22 | /^=/,
|
---|
| 23 | {
|
---|
| 24 | pattern: /^(\s*)["']|["']$/,
|
---|
| 25 | lookbehind: true
|
---|
| 26 | }
|
---|
| 27 | ]
|
---|
| 28 | }
|
---|
| 29 | },
|
---|
| 30 | punctuation: /\]/,
|
---|
| 31 | 'attr-name': /[^\s=\]]+/
|
---|
| 32 | }
|
---|
| 33 | }
|
---|
| 34 | }
|
---|
| 35 | Prism.languages.shortcode = Prism.languages.bbcode
|
---|
| 36 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.