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

Don’t skip adjacent top-level headings #3

Closed
wants to merge 1 commit into from

Conversation

eush77
Copy link
Contributor

@eush77 eush77 commented Jul 15, 2015

This patch fixes the issue with iterating over adjacent title headings and removing nodes in lib/transformer.js.

In the example below, as the first heading is removed, the index of the second one becomes 0 and the second heading is skipped. titleCount == 1, the depth of the remaining heading remains intact, and it renders to .SS command.

# One

# Two

...the rest of the document...

This patch defers AST mutation until the traversal is over.

@wooorm wooorm changed the title Don\'t skip adjacent top-level headings Don’t skip adjacent top-level headings Jul 15, 2015
@wooorm wooorm closed this in f243574 Jul 15, 2015
@wooorm
Copy link
Member

wooorm commented Jul 15, 2015

Thanks! Could you, in the future, also call npm run build before PRing? Saves me some time! 😉

@eush77
Copy link
Contributor Author

eush77 commented Jul 15, 2015

Sure!

@eush77 eush77 deleted the adjacent-top-level branch July 15, 2015 10:23
@wooorm wooorm added ⛵️ status/released 🐛 type/bug This is a problem 👶 semver/patch This is a backwards-compatible fix 🗄 area/interface This affects the public interface labels Aug 15, 2019
@wooorm wooorm added the 💪 phase/solved Post is done label Aug 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🗄 area/interface This affects the public interface 💪 phase/solved Post is done 👶 semver/patch This is a backwards-compatible fix 🐛 type/bug This is a problem
Development

Successfully merging this pull request may close these issues.

2 participants