rubyapi: "See also" links are incorrect

I was watching @ioquatix’s Async::HTTP::Cache video and noticed weird errors in the benchmarker, so I paused the video.

Screen Shot 2020-04-04 at 10 54 13 AM

On https://rubyapi.org/2.7/o/string#method-i-concat

<p>See also <a href="String.html#method-i-3C-3C"><code>String#&lt;&lt;</code></a>, which takes a single argument.</p>

Seems like that url should either simply be #method-i-3C-3C or /2.7/o/string.html#method-i-3C-3C. But this String.html path is wrong.

Interestingly, my browser makes a sensible URL out of it. https://rubyapi.org/2.7/o/String.html#method-i-3C-3C. And since Rails interprets the .html as the format of HTML (which is the default), and Elasticsearch finds String just fine (case insensitive search), the link actually works fine.

But still, the URL there is not consistent with the rest of the app. Maybe we don’t care, but I believe this will cause page caching to store multiple copies of the page in memory, unless Async::HTTP::Cache is doing some sort of URL normalization on cache lookups.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 22 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Unfortunately, I doubt we’ll be able to solve this problem with Trenni::Parser at the moment. The screenshot from your live stream is a Trenni::ParserError because it can’t always parse the <a>, given the current invalid HTML. In fact, your code was doing most of what this would need to do – find the href in the appropriate <a>, but instead of making a web request to the URL, we want to change the URL.

Perhaps there’s a way to use Trenni::Parser to find the appropriate tags, and then fix the RDoc problem and the URLs all at the same time? Not sure.

I feel like editing the HTML is the better solution.

Yup. I posted the a m.description example a few comments above.