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

Inconstant List Indentation #616

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

progmem
Copy link

@progmem progmem commented May 20, 2017

Pull request for issue #615

Jason DeLeon added 3 commits May 20, 2017 01:29
…ation

By observing the data available at work->data, an interesting observation was noted that causes the tracking of indentation to be improperly handled. Specifically, the indentation on Item 3 appears to be handled incorrectly, which causes issues when scanning on the next iteration, from Item 2 downward.

To correct this, indentation is first handled as normal, checking up to four characters. We do this by initializing pre to our starting value, 4, then perform the indentation check using pre instead of the fixed value. Since pre is being updated constantly, this allows us to take the current indent and use it to properly crawl the list.

An interesting note is that the test for this issue will fail if you add a sixth-level item. This is due to max_nesting and how nesting is tracked on lists. On a linear list, a max_nesting of (1 + 2 + ... + n) is required, with n being the furthest nesting level. By default, max_nesting is 16, and a list 5 deep works, hitting a nesting of 15. However, with 6 levels, we need a max_nesting of 21 or greater.
@Stargator
Copy link

@progmem Can you rebase or resolve the conflict in the branch?

@progmem
Copy link
Author

progmem commented Sep 2, 2017

@Stargator Should be good now!

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.

2 participants