3 ms·
I can't find an RFC about this, but it looks like something similar has been proposed in the past, with a slightly different API. > In URIs for MIME text/plain
by ipsum2 8y ago
I can't find an RFC about this, but it looks like something similar has been proposed in the past, with a slightly different API.
> In URIs for MIME text/plain documents RFC 5147 specifies a fragment identifier for the character and line positions and ranges within the document using the keywords "char" and "line". Some popular browsers do not yet support RFC 5147.[5] The following example identifies lines 11 through 20 of a text document:
http://example.com/document.txt#line=10,20 http://example.com/document.txt#line=10,20
https://en.wikipedia.org/wiki/Fragment_identifier https://en.wikipedia.org/wiki/Fragment_identifier
- larkeith 8y agoI must say I prefer the RFC version - while still vulnerable to rotting from text changes, at least it should still link to the same general vicinity.
- mediumdeviation 8y agoHTML documents don't generally have the concept of lines since text reflow based on the way user agent (browser) is rendering the document. That's why the RFC only talks about text/plain MIME type - browsers render those with all line breaks intact. You can maybe use a CSS selectors, but that adds a tremendous amount of complexity and is not easy for non-web developers to read anymore.
- larkeith 8y agoOops, good point. I suppose you could do by newline/paragraph plus character instead, but that would be even more vulnerable to text changes.
- csarven 8y agoRight on. Different fragment selectors can be used depending on the media type of a representation: https://www.w3.org/TR/selectors-states/#selector https://www.w3.org/TR/selectors-states/#selector Expanded here: https://news.ycombinator.com/item?id=19169582 https://news.ycombinator.com/item?id=19169582