-
Notifications
You must be signed in to change notification settings - Fork 6
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
u- parsing should always do relative URL resolution #10
Comments
Use-case makes sense to me. And the change is relatively simple (move the relative URL resolution step after all the sources of retrieving the value). From a compat perspective it shouldn't break any existing working content, because such relative URLs outside of URL attributes don't work today anyway. The only "odd" side-effect that is possible is that some existing broken u-url property values may start suddenly "working". In addition if someone wants a non-relative-resolved "url" value from something like etc., they can just use p-url, e.g. and that way still get the old behavior (no idea why you would want that but just in case we're missing something). |
I'm in favor of changing the Another example of when you might want to use a Supporting relative URL resolution on any element whose value came from a |
We now have a pull request jekyll/minima#160 that depends on this newer behavior so lets get at least one parser implementing this (so I'll add it to the spec as provisional) and either approvals or no objections from other implementers so we can move forward quickly (will make it official in the spec). |
Since this greatly expands when relative URL resolution is done, this issue's resolution should depend on resolving #9 first. |
If I’m reading both correctly, this section on the “microformats2-parsing-faq” page on the wiki deals with this same topic. |
@bdesham, yes, and that FAQ item will need updating if the proposed change from this issue is accepted. The argument made there is that URLs being “displayed and used as is” by a browser should not be normalised, so microformats parsers will match browser output. This issue argues that doing that is not what is expected from microformats parsers. |
Upon reconsideration, I retract my suggestion in #10 (comment) that "this issue's resolution should depend on resolving #9 first", and commented on how to orthogonally resolve issue #9 (http://tantek.com/2018/107/t1). As promised in #10 (comment), I’ve added PROPOSED text inline in the u-* parsing section per the proposal of this issue: http://microformats.org/wiki/index.php?title=microformats2-parsing&diff=66782&oldid=66724. I see github.com/aaronpk’s agreement with this proposal, and would like to see at least one, preferably 2-3, more parser developer(s) explicitly agreeing as well. We also need to see this proposed change prototyped in at least one parser to make sure it is implementable (seems like it) and to see if there are any unintended consequences. (Originally published at: http://tantek.com/2018/107/t2/) |
Additionally there is a compelling use-case for this proposal: Permalink pages which do not link to themselves or otherwise display their own URL. This proposal would enable the relatively (so to speak) minimal markup: <data class="u-url" value=""></data> To provide the u-url for the h-entry of such permalink pages, instead of having to provide an absolute URL in the value attribute. (Originally published at: http://tantek.com/2018/107/t3/) |
I am definitely 👍 on this. Will free up some time to get a working implementation in the PHP parser. |
This matches the proposed parsing change from microformats/microformats2-parsing#10.
implements proposal in microformats/microformats2-parsing#10
I'm fully supportive of this. I've made the change in the go library (in a separate relurl branch for now) to see what tests will break, and the only one that does is microformats-v1/hcard/email. I'll prep a PR for the tests repo to fix this once this spec change goes in.
|
the fact that only one test broke also suggests that we should add a few additional test cases to cover this change. |
Even simpler, you could just have |
updates tests to match microformats/microformats2-parsing#10 by fixing one broken test in v1/hcard/email, and adding a new test in v2/hcard-relativeurlsempty that will pass only with the new parsing rules implemented.
updates tests to match microformats/microformats2-parsing#10 by fixing one broken test in v1/hcard/email, and adding a new test in v2/hcard-relativeurlsempty that will pass only with the new parsing rules implemented.
This has two implementations now and as far as I can see no objections, and thus should be ready to be integrated into the spec. |
PR available for mf2py: microformats/mf2py#139 |
Something else that was brought up: empty With two parsers update and the mf2py PR sitting I feel like it should be made permanent in the spec. If there are no further objections I'll update the wiki - at the latest during IWC this coming weekend. |
Resolution: proposal accepted. No objections in above discussion, and positive opinions (👍) from several implementors on the proposal. Proposal implementations in mf2py and microformats go parsers is sufficient to demonstrate implementability and interoperability (with updated tests cases), all as noted/linked in issue thread. Editing specification accordingly. (Originally published at: http://tantek.com/2018/358/t4/) |
implements proposal in microformats/microformats2-parsing#10
This question is separate from but affects #9.
Currently the parsing description for
u-
properties is as follows:Note that URL normalisation is applied on the fifth point. Values gained from VCP,
abbr
,data
, orinput
are never normalised. Is this really correct?I ran into an issue here when implementing a partial feed. In this case I did not want the feed title to link to itself as that made no sense in relation to the surrounding HTML. Thus I opted for
data
instead ofa
:However, because
data[value]
is never normalised, I am forced to write an absolute URL in there. That will hurt portability of the code.I also think it is bad for
input
based values. My reasoning here is that a microformats editor should be able to use the same parsing algorithm on the editing and on the output. But if someone writes#fragment
in aninput
-element text field the algorithm will output#fragment
, and if this is converted to ana
-element on save the same algorithm will outputhttps://example.com/#fragment
.I propose moving the 5th point (“if there is a gotten value, return the normalized absolute URL […]”) as far down the list as possible. Is there any reason why for specific elements this should not be done? I am not sure of
abbr
but can’t come up with anyabbr.u-x
use-cases either.If people can come up with good reasons why outputs for
u-
properties should not always be normalised on VCP andabbr
I still propose to move thedata
/input
case to be above the normalisation step.The text was updated successfully, but these errors were encountered: