Skip to content

Commit

Permalink
Add support for blank lines in code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
guifre committed Sep 11, 2017
1 parent e45a274 commit cbfa4d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions notes2html.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def escape(line):


def tabs_to_spaces(line):
return line.replace('\t\t\t', ' ').replace('\t\t', ' ').replace('\t', ' ')
return line.replace('\t\t\t', ' ').replace('\t\t', ' ').replace('\t', ' ').replace('\r', ' ')


def build_indentation(next_level, is_narrative):
Expand All @@ -112,7 +112,7 @@ def get_white_spacing(next_level):


def line_finishes_code_block(current_level, line):
return current_level == 'code' and line.endswith('*')
return current_level == 'code' and line.rstrip('\n').endswith('*')


def line_starts_code_block(current_level, line):
Expand Down

0 comments on commit cbfa4d1

Please sign in to comment.