diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/g2h/cli.py | 2 | ||||
| -rw-r--r-- | src/g2h/file_page.py | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/g2h/cli.py b/src/g2h/cli.py index fe3850c..bc59467 100644 --- a/src/g2h/cli.py +++ b/src/g2h/cli.py @@ -11,7 +11,7 @@ def parse_args(): parser.add_argument('--repo', help='Path to the root of git repository', default=os.getcwd()) parser.add_argument('--out', help='Path to where the generated files should be stored', default=os.getcwd()) # TODO: Add an actual default value. - parser.add_argument('--name', help='Name of the project. Default: directory name of repo') + parser.add_argument('--name', help='Name of the project. Default: directory name of repo (TODO)') parser.add_argument('--content-subdir', help='Subdir(s) where the page will be served from. Default: None', default='') return parser.parse_args() diff --git a/src/g2h/file_page.py b/src/g2h/file_page.py index d64cb84..f2e0550 100644 --- a/src/g2h/file_page.py +++ b/src/g2h/file_page.py @@ -38,8 +38,11 @@ class FilePage(Page): content, file_type = bytes_to_content(file_bytes) backtick_max = 2 if file_type == 'text': - matches = re.findall('`+', content) - backtick_max = max(max(len(match) for match in matches) if matches else 0, backtick_max) + if self.file_name.lower().endswith('.md'): + backtick_max = -1 + else: + matches = re.findall('`+', content) + backtick_max = max(max(len(match) for match in matches) if matches else 0, backtick_max) return { 'backtick_max': backtick_max + 1, |