MediaWiki:Common.js: Difference between revisions
No edit summary |
No edit summary |
||
| Line 518: | Line 518: | ||
var content=slot['*']||slot.content||''; | var content=slot['*']||slot.content||''; | ||
content=content | content=content | ||
.replace(/{{[ | .replace(/\{\{[\s\S]*?\}\}/g,' ') | ||
.replace(/[[File:[^]]+]]/gi,' ') | .replace(/[[File:[^]]+]]/gi,' ') | ||
.replace(/[[(?:[^]|]+|)?([^]]+)]]/g,'$1') | .replace(/[[(?:[^]|]+|)?([^]]+)]]/g,'$1') | ||
.replace(/<[^>]+>/g,' ') | .replace(/<[^>]+>/g,' ') | ||
.replace(/<!--[ | .replace(/<\!--[\s\S]*?-->/g,' ') | ||
.replace(/={2,}[^=]+=={2,}/g,' ') | .replace(/={2,}[^=]+=={2,}/g,' ') | ||
.replace(/[|!*#;:[]]/g,' ') | .replace(/[|!*#;:[]]/g,' ') | ||
.replace(/https?://S+/g,' ') | .replace(/https?:\/\/\S+/g,' ') | ||
.replace(/s+/g,' ').trim(); | .replace(/\s+/g,' ').trim(); | ||
map[pid].words=content?content.split(/s+/).filter(function(w){return w.length>1;}).length:0; | map[pid].words=content?content.split(/s+/).filter(function(w){return w.length>1;}).length:0; | ||
}); | }); | ||