From c549f0fc7f6d06c1b7202693a3f10cb4ec94fda9 Mon Sep 17 00:00:00 2001 From: Dmytro Yeroshkin Date: Fri, 22 Oct 2021 10:36:58 +0200 Subject: [PATCH] added support for markdown comments --- novel_stats/novel_stats.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/novel_stats/novel_stats.py b/novel_stats/novel_stats.py index 86a7f61..b4b19f2 100755 --- a/novel_stats/novel_stats.py +++ b/novel_stats/novel_stats.py @@ -8,6 +8,7 @@ import sys CHAPTER_MARKER = '## ' STATUS_MARKER = '[status]: # ' ACT_MARKER = '[act]: # ' +COMMENT_MARKER = '[//]: # ' def count_words(line): @@ -48,6 +49,8 @@ def main(): elif line.startswith(ACT_MARKER): act_number = int(line[len(ACT_MARKER):].strip('()\n')) word_count_by_act[act_number] = 1 + elif line.startswith(COMMENT_MARKER): + pass else: line_word_count = count_words(line) word_count_by_chapter[chapter_number] += line_word_count