Skip to content

Commit

Permalink
Readme defintion of each seems ot conflict with implementation
Browse files Browse the repository at this point in the history
The readme mentions that Node#each will iterate on a node and its first-level children (implying self will be yielded), but from [the source file](https://github.com/gjtorikian/commonmarker/blob/55c3b03708b31f1af37a53b3312f91400594223d/lib/commonmarker/node.rb#L27) it seems that only the children are yielded.
  • Loading branch information
stellarpower authored Oct 11, 2024
1 parent 55c3b03 commit adf5910
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ You can also modify the following attributes:
You can use `walk` or `each` to iterate over nodes:

- `walk` will iterate on a node and recursively iterate on a node's children.
- `each` will iterate on a node and its children, but no further.
- `each` will iterate on a node's direct children, but no further.

```ruby
require 'commonmarker'
Expand Down

0 comments on commit adf5910

Please sign in to comment.