Skip to content

Rewrite to not mutate given node #1

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

Merged
merged 1 commit into from
Jul 23, 2016
Merged

Rewrite to not mutate given node #1

merged 1 commit into from
Jul 23, 2016

Conversation

wooorm
Copy link
Member

@wooorm wooorm commented Jul 23, 2016

...and other changes:

  • Rewrite module to not mutate the given node,
    previously, slugs were added and the contents
    of the previous TOC (the nodes between the heading
    and the first heading in TOC were removed).
  • Remove dependency on remark, remark-slug;
  • Update example.js, usage section;
  • Add description of what is returned;
  • Fix different return values;
  • Remove an initial space character throughout list,
    list-item, and insert;
  • Fix bundle name: remarkTOC > mdastUtilTOC;
  • Rewrite tests to assert results of this module only.

/cc @BarryThePenguin I’d love to hear what you think about these changes. I believe it makes for a more solid approach, but if you don’t agree (on some parts), do let me know. Also: I’d gladly answer any question you might have. Last: This does include some breaking changes, I suggest releasing 2.0.0

...and other changes:

* Rewrite module to not mutate the given node,
  previously, slugs were added and the contents
  of the previous TOC (the nodes between the heading
  and the first heading in TOC were removed).
* Remove dependency on `remark`, `remark-slug`;
* Update `example.js`, usage section;
* Add description of what is returned;
* Fix different return values;
* Remove an initial space character throughout `list`,
  `list-item`, and `insert`;
* Fix bundle name: `remarkTOC` > `mdastUtilTOC`;
* Rewrite tests to assert results of this module only.
@wooorm wooorm added the 🦋 type/enhancement This is great to have label Jul 23, 2016
@codecov-io

This comment has been minimized.

@BarryThePenguin
Copy link
Member

Fantastic. That is a significant improvement on my attempt ☺️ I'm still figuring my way around the remark and unist landscape

The test output makes so much more sense as the actual output of the method...

@BarryThePenguin BarryThePenguin merged commit b74d0ab into master Jul 23, 2016
@BarryThePenguin BarryThePenguin deleted the changes branch July 23, 2016 12:23
@wooorm
Copy link
Member Author

wooorm commented Jul 23, 2016

I know, getting into unified/unist/remark/mdast, and whatnot, is a pretty daunting task. If you have any particular points which were hard to grasp, I’d love to hear about them!

@wooorm wooorm added ⛵️ status/released 🗄 area/interface This affects the public interface 🧑 semver/major This is a change labels Aug 12, 2019
@wooorm wooorm added the 💪 phase/solved Post is done label Apr 12, 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/major This is a change 🦋 type/enhancement This is great to have
Development

Successfully merging this pull request may close these issues.

3 participants