diff --git a/plugins/wpd/index.html b/plugins/wpd/index.html
index 74663045fb..555c38c815 100644
--- a/plugins/wpd/index.html
+++ b/plugins/wpd/index.html
@@ -50,10 +50,10 @@
CSS
HTML
-
+
SVG
-
+
diff --git a/plugins/wpd/prism-wpd.js b/plugins/wpd/prism-wpd.js
index 7900dd4ce5..595f34c8a5 100644
--- a/plugins/wpd/prism-wpd.js
+++ b/plugins/wpd/prism-wpd.js
@@ -8,8 +8,6 @@ if (
}
if (Prism.languages.css) {
- Prism.languages.css.atrule.inside['atrule-id'] = /^@[\w-]+/;
-
// check whether the selector is an advanced pattern before extending it
if (Prism.languages.css.selector.pattern)
{
@@ -57,60 +55,65 @@ var language;
Prism.hooks.add('wrap', function(env) {
if ((env.type == 'tag-id'
|| (env.type == 'property' && env.content.indexOf('-') != 0)
- || (env.type == 'atrule-id'&& env.content.indexOf('@-') != 0)
+ || (env.type == 'rule'&& env.content.indexOf('@-') != 0)
|| (env.type == 'pseudo-class'&& env.content.indexOf(':-') != 0)
|| (env.type == 'pseudo-element'&& env.content.indexOf('::-') != 0)
- || (env.type == 'attr-name' && env.content.indexOf('data-') != 0)
- ) && env.content.indexOf('<') === -1
+ || (env.type == 'attr-name' && env.content.indexOf('data-') != 0)
+ ) && env.content.indexOf('<') === -1
) {
- var searchURL = 'w/index.php?fulltext&search=';
+ if (env.language == 'css'
+ || env.language == 'scss'
+ || env.language == 'markup'
+ ) {
+ var searchURL = 'w/index.php?fulltext&search=';
- env.tag = 'a';
-
- var href = 'http://docs.webplatform.org/';
-
- if (env.language == 'css' || env.language == 'scss') {
- href += 'wiki/css/';
-
- if (env.type == 'property') {
- href += 'properties/';
- }
- else if (env.type == 'atrule-id') {
- href += 'atrules/';
- }
- else if (env.type == 'pseudo-class') {
- href += 'selectors/pseudo-classes/';
- }
- else if (env.type == 'pseudo-element') {
- href += 'selectors/pseudo-elements/';
- }
- }
- else if (env.language == 'markup') {
- if (env.type == 'tag-id') {
- // Check language
- language = getLanguage(env.content) || language;
-
- if (language) {
- href += 'wiki/' + language + '/elements/';
+ env.tag = 'a';
+
+ var href = 'http://docs.webplatform.org/';
+
+ if (env.language == 'css' || env.language == 'scss') {
+ href += 'wiki/css/';
+
+ if (env.type == 'property') {
+ href += 'properties/';
+ }
+ else if (env.type == 'rule') {
+ href += 'atrules/';
}
- else {
- href += searchURL;
+ else if (env.type == 'pseudo-class') {
+ href += 'selectors/pseudo-classes/';
+ }
+ else if (env.type == 'pseudo-element') {
+ href += 'selectors/pseudo-elements/';
}
}
- else if (env.type == 'attr-name') {
- if (language) {
- href += 'wiki/' + language + '/attributes/';
+ else if (env.language == 'markup') {
+ if (env.type == 'tag-id') {
+ // Check language
+ language = getLanguage(env.content) || language;
+
+ if (language) {
+ href += 'wiki/' + language + '/elements/';
+ }
+ else {
+ href += searchURL;
+ }
}
- else {
- href += searchURL;
+ else if (env.type == 'attr-name') {
+ if (language) {
+ href += 'wiki/' + language + '/attributes/';
+ }
+ else {
+ href += searchURL;
+ }
}
}
+
+ href += env.content;
+
+ env.attributes.href = href;
+ env.attributes.target = '_blank';
}
-
- href += env.content;
-
- env.attributes.href = href;
- env.attributes.target = '_blank';
}
});
diff --git a/plugins/wpd/prism-wpd.min.js b/plugins/wpd/prism-wpd.min.js
index 445e1a3435..d7b2a61511 100644
--- a/plugins/wpd/prism-wpd.min.js
+++ b/plugins/wpd/prism-wpd.min.js
@@ -1 +1 @@
-!function(){function e(e){var a=e.toLowerCase();if(t.HTML[a])return"html";if(t.SVG[e])return"svg";if(t.MathML[e])return"mathml";if(0!==t.HTML[a]&&"undefined"!=typeof document){var n=(document.createElement(e).toString().match(/\[object HTML(.+)Element\]/)||[])[1];if(n&&"Unknown"!=n)return t.HTML[a]=1,"html"}if(t.HTML[a]=0,0!==t.SVG[e]&&"undefined"!=typeof document){var r=(document.createElementNS("http://www.w3.org/2000/svg",e).toString().match(/\[object SVG(.+)Element\]/)||[])[1];if(r&&"Unknown"!=r)return t.SVG[e]=1,"svg"}return t.SVG[e]=0,0!==t.MathML[e]&&0===e.indexOf("m")?(t.MathML[e]=1,"mathml"):(t.MathML[e]=0,null)}if(("undefined"==typeof self||self.Prism)&&("undefined"==typeof global||global.Prism)){if(Prism.languages.css&&(Prism.languages.css.atrule.inside["atrule-id"]=/^@[\w-]+/,Prism.languages.css.selector.pattern?(Prism.languages.css.selector.inside["pseudo-class"]=/:[\w-]+/,Prism.languages.css.selector.inside["pseudo-element"]=/::[\w-]+/):Prism.languages.css.selector={pattern:Prism.languages.css.selector,inside:{"pseudo-class":/:[\w-]+/,"pseudo-element":/::[\w-]+/}}),Prism.languages.markup){Prism.languages.markup.tag.inside.tag.inside["tag-id"]=/[\w-]+/;var t={HTML:{a:1,abbr:1,acronym:1,b:1,basefont:1,bdo:1,big:1,blink:1,cite:1,code:1,dfn:1,em:1,kbd:1,i:1,rp:1,rt:1,ruby:1,s:1,samp:1,small:1,spacer:1,strike:1,strong:1,sub:1,sup:1,time:1,tt:1,u:1,"var":1,wbr:1,noframes:1,summary:1,command:1,dt:1,dd:1,figure:1,figcaption:1,center:1,section:1,nav:1,article:1,aside:1,hgroup:1,header:1,footer:1,address:1,noscript:1,isIndex:1,main:1,mark:1,marquee:1,meter:1,menu:1},SVG:{animateColor:1,animateMotion:1,animateTransform:1,glyph:1,feBlend:1,feColorMatrix:1,feComponentTransfer:1,feFuncR:1,feFuncG:1,feFuncB:1,feFuncA:1,feComposite:1,feConvolveMatrix:1,feDiffuseLighting:1,feDisplacementMap:1,feFlood:1,feGaussianBlur:1,feImage:1,feMerge:1,feMergeNode:1,feMorphology:1,feOffset:1,feSpecularLighting:1,feTile:1,feTurbulence:1,feDistantLight:1,fePointLight:1,feSpotLight:1,linearGradient:1,radialGradient:1,altGlyph:1,textPath:1,tref:1,altglyph:1,textpath:1,altglyphdef:1,altglyphitem:1,clipPath:1,"color-profile":1,cursor:1,"font-face":1,"font-face-format":1,"font-face-name":1,"font-face-src":1,"font-face-uri":1,foreignObject:1,glyphRef:1,hkern:1,vkern:1},MathML:{}}}var a;Prism.hooks.add("wrap",function(t){if(("tag-id"==t.type||"property"==t.type&&0!=t.content.indexOf("-")||"atrule-id"==t.type&&0!=t.content.indexOf("@-")||"pseudo-class"==t.type&&0!=t.content.indexOf(":-")||"pseudo-element"==t.type&&0!=t.content.indexOf("::-")||"attr-name"==t.type&&0!=t.content.indexOf("data-"))&&-1===t.content.indexOf("<")){var n="w/index.php?fulltext&search=";t.tag="a";var r="http://docs.webplatform.org/";"css"==t.language||"scss"==t.language?(r+="wiki/css/","property"==t.type?r+="properties/":"atrule-id"==t.type?r+="atrules/":"pseudo-class"==t.type?r+="selectors/pseudo-classes/":"pseudo-element"==t.type&&(r+="selectors/pseudo-elements/")):"markup"==t.language&&("tag-id"==t.type?(a=e(t.content)||a,r+=a?"wiki/"+a+"/elements/":n):"attr-name"==t.type&&(r+=a?"wiki/"+a+"/attributes/":n)),r+=t.content,t.attributes.href=r,t.attributes.target="_blank"}})}}();
\ No newline at end of file
+!function(){function e(e){var a=e.toLowerCase();if(t.HTML[a])return"html";if(t.SVG[e])return"svg";if(t.MathML[e])return"mathml";if(0!==t.HTML[a]&&"undefined"!=typeof document){var n=(document.createElement(e).toString().match(/\[object HTML(.+)Element\]/)||[])[1];if(n&&"Unknown"!=n)return t.HTML[a]=1,"html"}if(t.HTML[a]=0,0!==t.SVG[e]&&"undefined"!=typeof document){var s=(document.createElementNS("http://www.w3.org/2000/svg",e).toString().match(/\[object SVG(.+)Element\]/)||[])[1];if(s&&"Unknown"!=s)return t.SVG[e]=1,"svg"}return t.SVG[e]=0,0!==t.MathML[e]&&0===e.indexOf("m")?(t.MathML[e]=1,"mathml"):(t.MathML[e]=0,null)}if(("undefined"==typeof self||self.Prism)&&("undefined"==typeof global||global.Prism)){if(Prism.languages.css&&(Prism.languages.css.selector.pattern?(Prism.languages.css.selector.inside["pseudo-class"]=/:[\w-]+/,Prism.languages.css.selector.inside["pseudo-element"]=/::[\w-]+/):Prism.languages.css.selector={pattern:Prism.languages.css.selector,inside:{"pseudo-class":/:[\w-]+/,"pseudo-element":/::[\w-]+/}}),Prism.languages.markup){Prism.languages.markup.tag.inside.tag.inside["tag-id"]=/[\w-]+/;var t={HTML:{a:1,abbr:1,acronym:1,b:1,basefont:1,bdo:1,big:1,blink:1,cite:1,code:1,dfn:1,em:1,kbd:1,i:1,rp:1,rt:1,ruby:1,s:1,samp:1,small:1,spacer:1,strike:1,strong:1,sub:1,sup:1,time:1,tt:1,u:1,"var":1,wbr:1,noframes:1,summary:1,command:1,dt:1,dd:1,figure:1,figcaption:1,center:1,section:1,nav:1,article:1,aside:1,hgroup:1,header:1,footer:1,address:1,noscript:1,isIndex:1,main:1,mark:1,marquee:1,meter:1,menu:1},SVG:{animateColor:1,animateMotion:1,animateTransform:1,glyph:1,feBlend:1,feColorMatrix:1,feComponentTransfer:1,feFuncR:1,feFuncG:1,feFuncB:1,feFuncA:1,feComposite:1,feConvolveMatrix:1,feDiffuseLighting:1,feDisplacementMap:1,feFlood:1,feGaussianBlur:1,feImage:1,feMerge:1,feMergeNode:1,feMorphology:1,feOffset:1,feSpecularLighting:1,feTile:1,feTurbulence:1,feDistantLight:1,fePointLight:1,feSpotLight:1,linearGradient:1,radialGradient:1,altGlyph:1,textPath:1,tref:1,altglyph:1,textpath:1,altglyphdef:1,altglyphitem:1,clipPath:1,"color-profile":1,cursor:1,"font-face":1,"font-face-format":1,"font-face-name":1,"font-face-src":1,"font-face-uri":1,foreignObject:1,glyphRef:1,hkern:1,vkern:1},MathML:{}}}var a;Prism.hooks.add("wrap",function(t){if(("tag-id"==t.type||"property"==t.type&&0!=t.content.indexOf("-")||"rule"==t.type&&0!=t.content.indexOf("@-")||"pseudo-class"==t.type&&0!=t.content.indexOf(":-")||"pseudo-element"==t.type&&0!=t.content.indexOf("::-")||"attr-name"==t.type&&0!=t.content.indexOf("data-"))&&-1===t.content.indexOf("<")&&("css"==t.language||"scss"==t.language||"markup"==t.language)){var n="w/index.php?fulltext&search=";t.tag="a";var s="http://docs.webplatform.org/";"css"==t.language||"scss"==t.language?(s+="wiki/css/","property"==t.type?s+="properties/":"rule"==t.type?s+="atrules/":"pseudo-class"==t.type?s+="selectors/pseudo-classes/":"pseudo-element"==t.type&&(s+="selectors/pseudo-elements/")):"markup"==t.language&&("tag-id"==t.type?(a=e(t.content)||a,s+=a?"wiki/"+a+"/elements/":n):"attr-name"==t.type&&(s+=a?"wiki/"+a+"/attributes/":n)),s+=t.content,t.attributes.href=s,t.attributes.target="_blank"}})}}();
\ No newline at end of file