willnorris / microformats

Go library for parsing microformats
https://pkg.go.dev/willnorris.com/go/microformats
MIT License
64 stars 6 forks source link

fix: avoid panics in ParseNode() #21

Closed nekr0z closed 1 year ago

nekr0z commented 1 year ago

this fixes #20

ParseNode(node, nil) should be able to avoid panic even if node does not contain a valid absolute base path in its <head>, since there can be usable microformats with absolute paths or no paths.

ParseNode(nil, base) should return nil instead of panic, because why panic?

codecov-commenter commented 1 year ago

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage :thumbsup:

Coverage data is based on head (8b8e597) compared to base (ffbbdae). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #21 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 4 4 Lines 837 843 +6 ========================================= + Hits 837 843 +6 ``` | [Impacted Files](https://codecov.io/gh/willnorris/microformats/pull/21?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Will+Norris) | Coverage Δ | | |---|---|---| | [microformats.go](https://codecov.io/gh/willnorris/microformats/pull/21?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Will+Norris#diff-bWljcm9mb3JtYXRzLmdv) | `100.00% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Will+Norris). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Will+Norris)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

willnorris commented 1 year ago

awesome, thanks!