3 ms·
When I was working at The New York Times as a front-end developer I wanted to create a system where you could deep-link to any paragraph in a story, and potenti
by donohoe 3y ago
When I was working at The New York Times as a front-end developer I wanted to create a system where you could deep-link to any paragraph in a story, and potentially highlight passages of text.
Referencing a paragraph by order is very simple, but would not work in this case. It is not common for stories to be edited (correction, or updated as news event information becomes available) after publish - but it can happen. Likewise the inner text of the article could change.
Long-story short, I figured out the JS, learned about the Levenshtein distance for the first time, and built a robust tool that worked. Small things make me happy.
I also launched it without telling anyone. The blog post was retractive.
Source code:
https://github.com/nytimes/Emphasis https://github.com/nytimes/Emphasis
More information:
https://archive.nytimes.com/open.blogs.nytimes.com/2011/01/11/emphasis-update-and-source/ https://archive.nytimes.com/open.blogs.nytimes.com/2011/01/1...