Skip to content

Commit

Permalink
Code spans at start of line 2nd attempt.
Browse files Browse the repository at this point in the history
There were two obvious reasons why that was failing. That's what hapens
when I'm in a hurry. Fixed now.
  • Loading branch information
waylan committed Mar 26, 2019
1 parent 80668e3 commit 0b96cfb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion markdown/htmlparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def at_line_start(self):
if self.offset > 3:
return False
# Confirm up to first 3 chars are whitespace
return self.rawdata[self.line_offset:self.offset].strip() == ''
return self.rawdata[self.line_offset:self.line_offset + self.offset].strip() == ''

def handle_starttag(self, tag, attrs):
self.stack.append(tag)
Expand Down
5 changes: 2 additions & 3 deletions tests/test_syntax/blocks/test_html_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ def test_raw_surrounded_by_text_without_blank_lines(self):
)
)

# TODO: Fix this. Not sure why its failing...
def test_multiline_markdown_with_code_span(self):
self.assertMarkdownRenders(
self.dedent(
Expand All @@ -240,8 +239,8 @@ def test_multiline_markdown_with_code_span(self):
self.dedent(
"""
<p>A paragraph with a block-level
<code>&lt;p&gt;code span&lt;/p&gt;</code>.
More <em>Markdown</em> text.</p>
<code>&lt;p&gt;code span&lt;/p&gt;</code>, which is
at the start of a line.</p>
"""
)
)
Expand Down

0 comments on commit 0b96cfb

Please sign in to comment.