diff options
author | Katharina Fey <kookie@spacekookie.de> | 2020-01-15 23:12:21 +0000 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2020-01-15 23:12:21 +0000 |
commit | 5378cd5a94768bb62a73e20fbd6be16e6f109d7a (patch) | |
tree | 06c316119450fd3db27dde2d1dc32e51a5368a87 /plugins | |
parent | c7ff83176abe03c400b218e1a61d1b6b3e91a907 (diff) |
blog/git-mail: getting post into shape and fixing some style issues
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/read_time/read_time.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/read_time/read_time.py b/plugins/read_time/read_time.py index ccd4a07..f7b978b 100644 --- a/plugins/read_time/read_time.py +++ b/plugins/read_time/read_time.py @@ -61,15 +61,20 @@ def calculate_wpm(text, data, language): new_text = "" skipping = False for word in text.split(' '): + print(word) if '<skip>' in word: skipping = True + elif '<pre>' in word: + skipping = True if not skipping: new_text += word + ' ' if '</skip>' in word: skipping = False - + elif '</pre>' in word: + skipping = False + read_time = len(new_text.split(' ')) / wpm # Articles cannot take 0 minutes to read |