mdn / yari

The platform code behind MDN Web Docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

proposal: remove the `title` parameter from `smartLink()`

yin1999 opened this issue · comments

commented

Context:

I'm trying to remove broken-link-flaw reports to missing translation as broken if en-US fallback exists from smartLink(). I found that the smartLink() method lacks documentation for its parameters and contains too many parameters, which makes it difficult to be used in macros.

As I dug deeper, I found that it will add a title attribute to the generated <a> tags when this arg is provided. Then I investigated the usage of smartLink() and found that only one macro passed the title parameter, and the set title overlapped with the link text:

I think we can safely remove this parameter and clean up the function calls.

I think your suggestion makes sense, but we're currently working on a rewrite of the build system including macros, so we're refraining from making changes this like this at this point. I'll add the "on hold" label and we can get back to this later.