-
Notifications
You must be signed in to change notification settings - Fork 28
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
Resolve relative URLs in e-* HTML content #181
Comments
From the HTML attributes table referenced in @Zegnat's proposal I see the following URL attributes:
Do we need to support ping, forms or microdata? Can this wait until after the transition to py3? |
Thanks! I expect it's fine to ship an initial implementation of this with just the first line: href, src, cite, data, poster, probably in that priority order. The rest seem very low priority and/or unwanted entirely. (Also mf2py migrated to python 3 ages ago, that's not a blocker here.) |
Oops, I meant to say "transition away from py2" or "transition to py3 only". With py3 wheels we can install lxml without having to compile and thus it's possible to add it as a core dependency. If that were to be the case we could use their machinery: https://lxml.de/lxmlhtml.html#working-with-links Here's their code: https://github.com/lxml/lxml/blob/11b33a83ad689bd16bd0a98c14cda51a90572b73/src/lxml/html/__init__.py#L435 It's a bit of a stretch but also a nod toward feature freeze in anticipation of deprecation of py2. |
I'll work on support for |
I went through this exercise a few weeks ago, and compiled a list of URL-holding attributes from the HTML, MathML 3, and SVG Tiny specifications:
Then you also have image candidate strings (comma-separated):
And finally, URL token-lists (whitespace-separated):
Of all these href on base is a special case (its own value is not considered for resolution), as is xml:base. Attributes on foreign elements should probably also perform xml:base resolution in addition to HTML base resolution. |
@JKingweb what do you think about supporting the minimal case for now? https://github.com/microformats/mf2py/pull/201/files#diff-746fcc4c80a0a67fedb71d5bed24ae4a0e4925083edd63a8cef66eadc69a4cb3R100 |
fixes #390, re microformats/mf2py#181 . thank you again @angelogladding!
fixes #390, re microformats/mf2py#181 . thank you again @angelogladding!
Inspired by snarfed/bridgy-fed#390 (comment), open parsing issue microformats/microformats2-parsing#38, related implementation details in #138.
The text was updated successfully, but these errors were encountered: