Skip to content

Commit

Permalink
fix for normalize space function (proycon/folia#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
proycon committed Mar 25, 2021
1 parent ac00454 commit 3e6e1bc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions folia/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,9 +485,8 @@ def parsetime(s):


def norm_spaces(s):
r"""Normalize spaces, splits on whitespace (\t\s) and rejoins"""
return " ".join(re.split(r"\s+",s))

r"""Normalize spaces, splits on all kinds of whitespace and rejoins"""
return " ".join(( x for x in re.split(r"\s+",s) if x))

def postprocess_spaces(s):
r"""Postprocessing for spaces, translates temporary \0 bytes to spaces if they are are not preceeded by whitespace"""
Expand Down

0 comments on commit 3e6e1bc

Please sign in to comment.