Fixes: #61. Allows subsequent text blocks.#62
Conversation
|
|
||
| # remove indents | ||
| list(map(self.pre_process_code_block, code_blocks)) | ||
| for pos, block in code_blocks: |
There was a problem hiding this comment.
Using a for-loop explicitly states that we are side-effecting and we're not interested in the map return.
|
|
||
| # Merge back text and code blocks using the | ||
| # start position. | ||
| all_blocks = sorted(text_blocks + code_blocks) |
There was a problem hiding this comment.
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.