forked from mmcdole/gofeed
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Atom: implement xml:base relative URI resolution
What it does: Resolve relative URIs in feed element attributes, feed elements which contain URIs (like author:uri), and HTML element attributes in atom elements of type "html" or "xhtml" according to the xml:base specification (https://www.w3.org/TR/xmlbase/) What it is: The XMLBase type and functions live in the internal/shared package (internal/shared/xmlbase.go), with a minimalish patch against atom/parser.go. Tests live in testdata/parser/atom/ and are adapted from the python feedparser project: https://github.com/kurtmckee/feedparser/tree/master/feedparser/tests/wellformed/base How it works: As each atom element is parsed, a new xml:base is pushed to the stack; the top xml:base URI is used to resolve attributes (uses golang.org/x/net/html to parse any "html" or "xhtml" element content); then the base is popped from the stack. The shared.FindRoot() and shared.NextTag() functions have been moved to methods of XMLBase so that they can manage the xml:base url stack.
- Loading branch information
Showing
59 changed files
with
752 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.