Content: Issue with "String.prototype.replace()": …

Created on 28 Jan 2021  Â·  14Comments  Â·  Source: mdn/content

MDN URL: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace

What information was incorrect, unhelpful, or incomplete?

Internal link to "Specifying a function as a parameter"

Specific section or headline?

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#parameters

What did you expect to see?

Clicking on

The arguments supplied to this function are described in the <a>Specifying a function as a parameter</a> section below.

Should move users to…

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter



MDN Content page report details

10 minute task JS

All 14 comments

Hello, I would like to take this as my first issue.

So, inspecting the page I can see that both "Specifying a function as a parameter" and "Specifying a string as a parameter" internal links have typos, but the file on GitHub is a bit different and does not contain the typos. How should I proceed?

Hm, okay.

Are you familiar with Node.js and/or git?
If so, you could set up a local environment:
https://github.com/mdn/content#more-substantial-changes
and test the changes there.

If not I can check it out for you.

The idea is to be able to make changes locally (= on your machine) and check whether it fixes the problem. If you need help, let us know.

With git, yes.
I'll check if it works!

The links are working fine, there was no need to change anything.

Hm. As far as I know, at build time, the ID get's lowercased.
Could you submit a PR with both (id and href) using a lowercased version?
It can take up to 48h after a PR gets merged to show up on production.

Ok, so I'll do that to every id and href on this file, not just those mentioned earlier, because all of them are uppercased.

Yes, please! Looking forward to your PR :-)
(I'm going to be offline for the rest of the day)

1906

Oh no. It's either a regression or it's a matter of some code that hasn't landed yet :(

But if the raw HTML is this:

<a href="#Specifying_a_function_as_a_parameter">Specifying a function as a parameter</a>

it should become...

<a href="#specifying_a_function_as_a_parameter">Specifying a function as a parameter</a>

...when it gets rendered out.
I'll take care of looking into this on the Yari side.

Thanks for tracking this, @peterbe

I'm going to make https://github.com/mdn/yari/issues/2763 a priority. What's happening is that the anchor links only get "corrected" in build-time if you have flaw detection enabled. Something we don't have when we run the prod builds.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace now works. Yay! If, at the time of writing/reading this, you still see the old behavior, mess with the casing of the URL pathname so the CDN serves you a "cold" hit rather than something from our 24h caching.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

arturcarvalho picture arturcarvalho  Â·  5Comments

vinyldarkscratch picture vinyldarkscratch  Â·  4Comments

ydaniv picture ydaniv  Â·  4Comments

StephanieCunnane picture StephanieCunnane  Â·  4Comments

sanoodles picture sanoodles  Â·  3Comments