Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 FIX: Combination of blockquotes, list and newlines causes IndexError #207

Merged
merged 3 commits into from
Apr 15, 2022

Conversation

hukkin
Copy link
Member

@hukkin hukkin commented Apr 13, 2022

Closes #204

@codecov
Copy link

codecov bot commented Apr 13, 2022

Codecov Report

Merging #207 (3fa0fb5) into master (8928b0e) will decrease coverage by 0.06%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master     #207      +/-   ##
==========================================
- Coverage   96.17%   96.10%   -0.07%     
==========================================
  Files          61       61              
  Lines        3213     3211       -2     
==========================================
- Hits         3090     3086       -4     
- Misses        123      125       +2     
Flag Coverage Δ
pytests 96.10% <0.00%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
markdown_it/rules_block/blockquote.py 100.00% <ø> (ø)
markdown_it/rules_block/state_block.py 95.68% <0.00%> (-1.46%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8928b0e...3fa0fb5. Read the comment docs.

@@ -296,6 +296,4 @@ def blockquote(state: StateBlock, startLine: int, endLine: int, silent: bool):

state.blkIndent = oldIndent

state.lineMax += 1
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -147,7 +147,6 @@ def skipEmptyLines(self, from_pos: int) -> int:
]:
break
except IndexError:
from_pos += 1
Copy link
Member Author

@hukkin hukkin Apr 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This increment seems like a porting error of the JS for loop so removing it. Actually the break statement seems incorrect here. Using pass now to emulate a falsy condition of the if statement.

Copy link
Member

@chrisjsewell chrisjsewell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM cheers

@chrisjsewell chrisjsewell merged commit 2a67873 into executablebooks:master Apr 15, 2022
@hukkin hukkin deleted the issue-204 branch April 15, 2022 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Combination of blockquotes, list and newlines causes an IndexError
2 participants