question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Yari flaw fixes causing xref macro arguments to be incorrect?

See original GitHub issue

In https://github.com/mdn/content/pull/1236, @nschonni did a bunch of automated flaw fixes, mainly on the links in the affected articles.

I noted that in a couple of cases, xref macro arguments had been changed so they still worked, but the resulting link text was incorrect. For example {{domxref("RandomSource")}} got changed to {{domxref("Crypto/getRandomValues")}}, whereas it should be {{domxref("Crypto.getRandomValues")}}.

This occurred in files/en-us/glossary/rng/index.html.

Can you have a look into this? Thanks!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
chrisdavidmillscommented, Jan 15, 2021

@peterbe sure thing. When you use the one-argument version of an xref macro, the slug and the link text are derived from the argument value. The link text is exactly the same as the argument value, whereas the slug fragment is modified if necessary, to the form it needs to be in.

So if you put {{domxref("Document.body")}}, the link text will be “Document.body”, but the slug fragment is updated to “Document/body” so the URL is well-formed.

But if you put {{domxref("Document/body")}} the link text will be"Document/body", which is not what we want (the slug fragment is still correct).

There is also a two-argument version, which allows you to specify the slug fragment and link text separately, e.g. {{domxref("Document/body", "Document.body")}}. It would be a pain to write this explicitly each time you want to write such a call.

0reactions
chrisdavidmillscommented, Jan 15, 2021

@chrisdavidmills I didn’t appreciate that the text becomes / too. I don’t know what I was thinking, but I thought it would become <a href=".../Document/body"><code>body</code></a> but your point is that it becomes <a href=".../Document/body"><code>Document/body</code></a> which isn’t how APIs are described or used.

Yup, got it in one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix this XREF PROBLEM in AutoCAD - YouTube
Fix this XREF PROBLEM in AutoCADHi friend In this AutoCAD tutorial, I share how to fix xref failed to bind due to proxy...
Read more >
KumaScript - O projeto MDN - MDN Web Docs
Executes and returns the result of the named template with the given list of parameters. Example: <%- template("warning", ["foo", "bar", "baz"]) ...
Read more >
Xref Macros and Page Links :: Antora Docs
An AsciiDoc xref macro is used to create a source-to-source cross reference from a resource to a publishable resource. The term cross reference,...
Read more >
Untitled
#chad Hova mesz, Yitzchak meir helfgot concert, Degeneracy problem particle ... Mossuto's market hours, Kimery events, L'ocell de la revolta argument, ...
Read more >
GNU bug reports: package emacs
Package: emacs; Reported by: Stefan Monnier <monnier@HIDDEN>; 43 days old. #59206: rmail-summary-apply-filters-consecutively causes wrong-type-argument error
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found