User:Bosco/Unsigned helper.js: Difference between revisions
From Test Wiki
Content deleted Content added
searchFromIndex: fix error message |
doAddUnsignedTemplate: improve filtering of the selection to filter out output of Template:Unsigned and Template:Unsigned IP – when the output ends in a closing tag </small> |
||
| Line 511: | Line 511: | ||
let selection = originalSelection; |
let selection = originalSelection; |
||
debug(`doAddUnsignedTemplate: getSelection: '${selection}'`); |
debug(`doAddUnsignedTemplate: getSelection: '${selection}'`); |
||
selection = selection.replace(new RegExp('[\\s\\S]*\\d\\d:\\d\\d, \\d+ (' + months.join('|') + ') \\d\\d\\d\\d \\(UTC\\)'), ''); |
selection = selection.replace(new RegExp('[\\s\\S]*\\d\\d:\\d\\d, \\d+ (' + months.join('|') + ') \\d\\d\\d\\d \\(UTC\\)([<]/small[>])?'), ''); |
||
selection = selection.replace(/[\s\S]*\n=+.*=+\s*\n/, ''); |
selection = selection.replace(/[\s\S]*\n=+.*=+\s*\n/, ''); |
||
selection = selection.replace(/^\s+|\s+$/g, ''); |
selection = selection.replace(/^\s+|\s+$/g, ''); |
||