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.

On https://rubyapi.org/2.7/o/string#method-i-concat
<p>See also <a href="String.html#method-i-3C-3C"><code>String#<<</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
- Make RDoc links be consistent with the rest of the Rails app RDoc's links are relative paths from the current file, where the path is the exact casing as the class, and end in .html. These links wor... — committed to natematykiewicz/rubyapi by natematykiewicz 4 years ago
- Make RDoc links be consistent with the rest of the Rails app RDoc's links are relative paths from the current file, where the path is the exact casing as the class, and end in .html. These links wor... — committed to natematykiewicz/rubyapi by natematykiewicz 4 years ago
- Make RDoc links be consistent with the rest of the Rails app RDoc's links are relative paths from the current file, where the path is the exact casing as the class, and end in .html. These links wor... — committed to natematykiewicz/rubyapi by natematykiewicz 4 years ago
- Make RDoc links be consistent with the rest of the Rails app RDoc's links are relative paths from the current file, where the path is the exact casing as the class, and end in .html. These links wor... — committed to natematykiewicz/rubyapi by natematykiewicz 4 years ago
- Make RDoc links be consistent with the rest of the Rails app RDoc's links are relative paths from the current file, where the path is the exact casing as the class, and end in .html. These links wor... — committed to natematykiewicz/rubyapi by natematykiewicz 4 years ago
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::ParserErrorbecause 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 thehrefin 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::Parserto 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.descriptionexample a few comments above.