Skip to content

Commit

Permalink
trim text lines (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
RouxRC committed May 5, 2017
1 parent 1d93311 commit 7bdd6f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions gazouilleur/lib/webmonitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def absolutize_links(url, html):
re_clean_style = re.compile(ur'<style[^>]*/?>.*?</style>', re.I|re.DOTALL)
re_clean_balises = re.compile(ur'<[/!?]?\[?[a-z0-9\-]+[^>]*>', re.I|re.DOTALL)
re_clean_blanks = re.compile(ur'[ \t\f\v]+')
re_clean_multiCR = re.compile(ur'( ?[\n\r]+)+',re.M)
re_clean_multiCR = re.compile(ur'(\s?[\n\r]+)+\s*',re.M)
def extract_raw_text(html):
text = replace_entities(html)
text = re_clean_blanks.sub(u' ', text)
Expand All @@ -186,7 +186,7 @@ def extract_raw_text(html):
text = re_clean_style.sub(u' ', text)
text = re_clean_balises.sub(u' ', text)
text = re_clean_blanks.sub(u' ', text).strip()
text = re_clean_multiCR.sub(u'\n\r', text)
text = re_clean_multiCR.sub(u'\n', text)
return text


Expand Down
1 change: 0 additions & 1 deletion web/js/webmonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
- juggle between view and diff modes
- slider/calendar picker
- css full height + accordeon
- trim strings in python
*/
(function(ns){
ns.last = ns.versions[ns.versions.length - 1];
Expand Down

0 comments on commit 7bdd6f1

Please sign in to comment.