Framawiki has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/387938 )

Change subject: Get removeUselessSpaces working with tabs
......................................................................

Get removeUselessSpaces working with tabs

Bug: T179043
Change-Id: I65c57ace1a2357ece28e1cbab258574d117d57a6
---
M pywikibot/cosmetic_changes.py
M tests/cosmetic_changes_tests.py
2 files changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/38/387938/1

diff --git a/pywikibot/cosmetic_changes.py b/pywikibot/cosmetic_changes.py
index 179542e..6631531 100755
--- a/pywikibot/cosmetic_changes.py
+++ b/pywikibot/cosmetic_changes.py
@@ -621,7 +621,7 @@
         exceptions = ['comment', 'math', 'nowiki', 'pre', 'startspace', 
'table']
         if self.site.sitename != 'wikipedia:cs':
             exceptions.append('template')
-        text = textlib.replaceExcept(text, r'(?m) +( |$)', r'\1', exceptions,
+        text = textlib.replaceExcept(text, r'(?m)[\t ]+( |$)', r'\1', 
exceptions,
                                      site=self.site)
         return text
 
diff --git a/tests/cosmetic_changes_tests.py b/tests/cosmetic_changes_tests.py
index 668fdb1..83d2c4e 100644
--- a/tests/cosmetic_changes_tests.py
+++ b/tests/cosmetic_changes_tests.py
@@ -70,6 +70,9 @@
         # startspace
         self.assertEqual(' Foo  bar ',
                          self.cct.removeUselessSpaces(' Foo  bar '))
+        # tab
+        self.assertEqual('Fooooo bar',
+                         self.cct.removeUselessSpaces('Fooooo bar      '))
 
     def test_removeNonBreakingSpaceBeforePercent(self):
         """Test removeNonBreakingSpaceBeforePercent method."""

-- 
To view, visit https://gerrit.wikimedia.org/r/387938
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I65c57ace1a2357ece28e1cbab258574d117d57a6
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Framawiki <framaw...@tools.wmflabs.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to