你现在正在访问的是萌娘百科用于保存和管理图片、音频等媒体文件的子项目萌娘共享,想要回到萌娘百科,请使用浏览器上的返回按钮、或点击这里
“MediaWiki:Gadget-prism-language-markup.js”的版本间的差异
AnnAngela-dbot(讨论 | 贡献) (代码变动:2d5d0ae - feat(Gadget/prism): 新的代码高亮工具 (#443) by U:AnnAngela, co-authored-by: GH:github-actions[bot],U:Bhsd) (1个标签:由机器人或全自动脚本执行的操作) |
AnnAngela-dbot(讨论 | 贡献) (代码变动:2d5d0ae3 - feat(Gadget/prism): 新的代码高亮工具 (#443) by U:AnnAngela, co-authored-by: GH:github-actions[bot],U:Bhsd) (1个标签:由机器人或全自动脚本执行的操作) |
||
第4行: | 第4行: | ||
* ------------------------------------------------------------------------- | * ------------------------------------------------------------------------- | ||
*/ | */ | ||
− | var _addText = '{{GHIACode|page=GHIA:MoegirlPediaInterfaceCodes/blob/master/src/gadgets/prism-language-markup/MediaWiki:Gadget-prism-language-markup.js|user=[[U:AnnAngela]]|co-authors=GH:github-actions[bot]、[[U:Bhsd]]|longId=2d5d0ae30421796cfa323a02a78713c0ed261417|shortId= | + | var _addText = '{{GHIACode|page=GHIA:MoegirlPediaInterfaceCodes/blob/master/src/gadgets/prism-language-markup/MediaWiki:Gadget-prism-language-markup.js|user=[[U:AnnAngela]]|co-authors=GH:github-actions[bot]、[[U:Bhsd]]|longId=2d5d0ae30421796cfa323a02a78713c0ed261417|shortId=2d5d0ae3|summary=feat(Gadget/prism): 新的代码高亮工具 (#443)|body=<nowiki>Co-authored-by: github-actions[bot] <41898282+github-actions[bot]📧users.noreply.github.com>↩Co-authored-by: Bhsd <55071315+bhsd-harry📧users.noreply.github.com></nowiki>}}'; |
/* <pre> */ | /* <pre> */ |
2024年4月16日 (二) 09:09的最新版本
/** * ------------------------------------------------------------------------- * !!! DON'T MODIFY THIS PAGE MANUALLY, YOUR CHANGES WILL BE OVERWRITTEN !!! * ------------------------------------------------------------------------- */ var _addText = '{{GHIACode|page=GHIA:MoegirlPediaInterfaceCodes/blob/master/src/gadgets/prism-language-markup/MediaWiki:Gadget-prism-language-markup.js|user=[[U:AnnAngela]]|co-authors=GH:github-actions[bot]、[[U:Bhsd]]|longId=2d5d0ae30421796cfa323a02a78713c0ed261417|shortId=2d5d0ae3|summary=feat(Gadget/prism): 新的代码高亮工具 (#443)|body=<nowiki>Co-authored-by: github-actions[bot] <41898282+github-actions[bot]📧users.noreply.github.com>↩Co-authored-by: Bhsd <55071315+bhsd-harry📧users.noreply.github.com></nowiki>}}'; /* <pre> */ "use strict"; Prism.languages.markup = { 'comment': { pattern: /<!--(?:(?!<!--)[\s\S])*?-->/, greedy: true }, 'prolog': { pattern: /<\?[\s\S]+?\?>/, greedy: true }, 'doctype': { pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i, greedy: true, inside: { 'internal-subset': { pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/, lookbehind: true, greedy: true, inside: null }, 'string': { pattern: /"[^"]*"|'[^']*'/, greedy: true }, 'punctuation': /^<!|>$|[[\]]/, 'doctype-tag': /^DOCTYPE/i, 'name': /[^\s<>'"]+/ } }, 'cdata': { pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i, greedy: true }, 'tag': { pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/, greedy: true, inside: { 'tag': { pattern: /^<\/?[^\s>\/]+/, inside: { 'punctuation': /^<\/?/, 'namespace': /^[^\s>\/:]+:/ } }, 'special-attr': [], 'attr-value': { pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/, inside: { 'punctuation': [ { pattern: /^=/, alias: 'attr-equals' }, { pattern: /^(\s*)["']|["']$/, lookbehind: true } ] } }, 'punctuation': /\/?>/, 'attr-name': { pattern: /[^\s>\/]+/, inside: { 'namespace': /^[^\s>\/:]+:/ } } } }, 'entity': [ { pattern: /&[\da-z]{1,8};/i, alias: 'named-entity' }, /&#x?[\da-f]{1,8};/i ] }; Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] = Prism.languages.markup['entity']; Prism.languages.markup['doctype'].inside['internal-subset'].inside = Prism.languages.markup; Prism.hooks.add('wrap', function (env) { if (env.type === 'entity') { env.attributes['title'] = env.content.replace(/&/, '&'); } }); Object.defineProperty(Prism.languages.markup.tag, 'addInlined', { value: function addInlined(tagName, lang) { var includedCdataInside = {}; includedCdataInside['language-' + lang] = { pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i, lookbehind: true, inside: Prism.languages[lang] }; includedCdataInside['cdata'] = /^<!\[CDATA\[|\]\]>$/i; var inside = { 'included-cdata': { pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i, inside: includedCdataInside } }; inside['language-' + lang] = { pattern: /[\s\S]+/, inside: Prism.languages[lang] }; var def = {}; def[tagName] = { pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function () { return tagName; }), 'i'), lookbehind: true, greedy: true, inside: inside }; Prism.languages.insertBefore('markup', 'cdata', def); } }); Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', { value: function (attrName, lang) { Prism.languages.markup.tag.inside['special-attr'].push({ pattern: RegExp(/(^|["'\s])/.source + '(?:' + attrName + ')' + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source, 'i'), lookbehind: true, inside: { 'attr-name': /^[^\s=]+/, 'attr-value': { pattern: /=[\s\S]+/, inside: { 'value': { pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/, lookbehind: true, alias: [lang, 'language-' + lang], inside: Prism.languages[lang] }, 'punctuation': [ { pattern: /^=/, alias: 'attr-equals' }, /"|'/ ] } } } }); } }); Prism.languages.html = Prism.languages.markup; Prism.languages.mathml = Prism.languages.markup; Prism.languages.svg = Prism.languages.markup; Prism.languages.xml = Prism.languages.extend('markup', {}); Prism.languages.ssml = Prism.languages.xml; Prism.languages.atom = Prism.languages.xml; Prism.languages.rss = Prism.languages.xml; /* </pre> */