Cscott has uploaded a new change for review. https://gerrit.wikimedia.org/r/78248
Change subject: Add '-m' option to dumpGrepper; add patterns for bug 41756. ...................................................................... Add '-m' option to dumpGrepper; add patterns for bug 41756. Change-Id: I453dab7d9187e7ba52ef9eee221f65882eb3e0b4 --- M js/tests/dumpGrepPatterns/misc.txt M js/tests/dumpGrepper.js 2 files changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid refs/changes/48/78248/1 diff --git a/js/tests/dumpGrepPatterns/misc.txt b/js/tests/dumpGrepPatterns/misc.txt index 0c5f05b..793b917 100644 --- a/js/tests/dumpGrepPatterns/misc.txt +++ b/js/tests/dumpGrepPatterns/misc.txt @@ -11,3 +11,8 @@ # cases which aren't the simple '| {{yes}}' case. [^ \t|]\s*{{\s*(?:rh|rh2|yes|Ya|no|Na|coming soon|bad|eliminated|Site active|Site inactive|good|yes2|won|no2|nom|sho|TBA|partial|yes-No|okay|some|any|n/a|BLACK|dunno|Unknown|Depends|Included|dropped|terminated|beta|table-experimental|free|nonfree|proprietary|needs|incorrect|no result|pending|nightly|release-candidate|[?]|unofficial|usually|rarely|sometimes|draw)\s*(?:[|]|}}) + +# blank lines with more than one comment (bug 41756) +^([ ]*<!--[^-]*?-->){2,}[ ]*$ (use with -m option) +# more precise version, avoid those surrounded by newlines +'[^\n]\n([ ]*<!--[^-]*?-->){2,}[ ]*\n(?!\n)' diff --git a/js/tests/dumpGrepper.js b/js/tests/dumpGrepper.js index a290885..d00ccfa 100755 --- a/js/tests/dumpGrepper.js +++ b/js/tests/dumpGrepper.js @@ -39,6 +39,11 @@ 'boolean': true, 'default': false }, + 'm': { + description: 'Treat ^ and $ as matching beginning/end of *each* line, instead of beginning/end of entire article', + 'boolean': true, + 'default': false + }, 'color': { description: 'Highlight matched substring using color. Use --no-color to disable. Default is "auto".', 'default': 'auto' @@ -60,6 +65,9 @@ if( Util.booleanOption( argv.i ) ) { flags += 'i'; } + if( Util.booleanOption( argv.m ) ) { + flags += 'm'; + } var re = new RegExp( argv._[0], flags ); var onlyFirst = Util.booleanOption( argv.l ); -- To view, visit https://gerrit.wikimedia.org/r/78248 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I453dab7d9187e7ba52ef9eee221f65882eb3e0b4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Parsoid Gerrit-Branch: master Gerrit-Owner: Cscott <canan...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits