-
Notifications
You must be signed in to change notification settings - Fork 115
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
Fixes: #61. Allows subsequent text blocks. #62
base: master
Are you sure you want to change the base?
Fixes: #61. Allows subsequent text blocks. #62
Conversation
for i, j in text_limits] | ||
|
||
# remove indents | ||
list(map(self.pre_process_code_block, code_blocks)) | ||
for pos, block in code_blocks: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a for-loop explicitly states that we are side-effecting and we're not interested in the map return.
notedown/notedown.py
Outdated
|
||
# Merge back text and code blocks using the | ||
# start position. | ||
all_blocks = sorted(text_blocks + code_blocks) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorted() uses the first tuple() argument (pos, an integer) to sort blocks.
2466ec8
to
f781fac
Compare
closed for recheck |
hey @ioggstream, thanks for the PR! Could you modify the tests so that they fail before this change and pass after? |
@aaren I submitted two patches in one. I will split this patch so that it does not modify the behavior of the code. |
f781fac
to
a63a128
Compare
a63a128
to
64f34ef
Compare
@aaren fixed this PR: now it has the same output testcase than before. |
I mean can you add something to tests.py that causes it to fail before this PR and to pass afterwards? I don't fully understand what this PR is fixing, as I think subsequent code blocks are already supported. |
What does this PR do?
Allows subsequent code and text blocks.
Reimplements text and code block merging tracking position.