Skip to content

Commit

Permalink
small bug fix in processors + version 0.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeauchesne committed Aug 10, 2018
1 parent 204cb1b commit 5040d14
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion campbot/processors/cleaners.py
Expand Up @@ -51,7 +51,7 @@ def repl(match):
result = protect(r"(?:\[.*\])\([^ \n\)]+\)", placeholder_pattern, result)
result = protect(r"https?://[^ )\n>]*", placeholder_pattern, result)
result = protect(r"www\.[^ )\n>\]]*", placeholder_pattern, result)
result = protect(r"\[\[[a-z]+/\d+/[/a-z0-9\-#]+\|", "[[" + placeholder_pattern + "|", result)
result = protect(r"\[\[[a-z]+/\d+[/a-z0-9\-#]*\|", "[[" + placeholder_pattern + "|", result)
result = protect(r":\w+:", placeholder_pattern, result)

result = super(OrthographicProcessor, self).modify(result)
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Expand Up @@ -6,13 +6,12 @@

setup(
name='campbot',
version="0.5.1",
version="0.5.3",
packages=find_packages(),
author="Charles de Beauchesne",
author_email="charles.de.beauchesne@gmail.com",
description="Package for automatic edition of camptocamp.org",
long_description=open('README.txt').read(),
python_requires="==2.7.*, ==3.4.*, ==3.5.*, ==3.6.*",
install_requires=install_requires,
include_package_data=True,

Expand Down
6 changes: 4 additions & 2 deletions tests/test_processors.py
Expand Up @@ -408,14 +408,16 @@ def test_auto_replacements():
"[www.a.com](https://www.b.eu/) - [www.c.eu](https://www.c.eu/)",
"référencée sur www.alpes-sud.net",
"[[articles/226763/fr/noeud-machard#machard-tresse-img-226816-right-no-border-no-legend|Machard tressé]]",
"[Les gites](/waypoints#a=14361%252C14328&wtyp=gite)"
"[Les gites](/waypoints#a=14361%252C14328&wtyp=gite)",
"[[articles/106920#comment-rediger-un-itineraire|voir l'aide]]"
]

p = AutomaticReplacements(lang="fr", comment="test", replacements=(
("deja", "déjà"),
("sud", "S"),
("noeud", "nœud"),
("gite", "gîte")
("gite", "gîte"),
('itineraire', "itinéraire")
)).modify

for markdown, expected in replaced:
Expand Down

0 comments on commit 5040d14

Please sign in to comment.