News for hackers. Stuff that matters.
Re:Chrome will Soon Let You Share Links to a Specific Word o... by ipsum2 on Friday February 15, 2019 @12:00AM (#19168563)
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

https://en.wikipedia.org/wiki/Fragment_identifier

Re:Chrome will Soon Let You Share Links to a Specific Word o... by csarven on Friday February 15, 2019 @08:39AM (#19170789)
Right on. Different fragment selectors can be used depending on the media type of a representation: https://www.w3.org/TR/selectors-states/#selector

Expanded here: https://news.ycombinator.com/item?id=19169582

Re:Chrome will Soon Let You Share Links to a Specific Word o... by larkeith on Friday February 15, 2019 @01:10AM (#19168821)
I 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.
Re:Chrome will Soon Let You Share Links to a Specific Word o... by mediumdeviation on Friday February 15, 2019 @02:05AM (#19169025)
HTML 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.
Re:Chrome will Soon Let You Share Links to a Specific Word o... by larkeith on Friday February 15, 2019 @08:14AM (#19170600)
Oops, good point. I suppose you could do by newline/paragraph plus character instead, but that would be even more vulnerable to text changes.