mdn / yari

The platform code behind MDN Web Docs
Mozilla Public License 2.0
1.18k stars 501 forks source link

Helping users with !, $, *. and certain other characters not indexed in the help system. #8574

Open dscotese opened 1 year ago

dscotese commented 1 year ago

MDN URL

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in

What specific section or headline is this issue about?

The use of the $ character in the code.

What information was incorrect, unhelpful, or incomplete?

It seems that $ has a meaning, since it, along with the variable between the braces and the braces themselves, is obviously expected to be converted to the value of that variable. When I put $ into the search box, I got hits for its use in regular expressions, but the site knows that might not be what I meant, so it helpfully offers to search for '$' by itself. That leads to a page that says "Search results for: $ Found 0 matches in 3 milliseconds." Thus, the Javascript reference documentation is not providing any documentation of the meaning of at least one character ($) that it uses in example code. That seems like an oversight to me.

What did you expect to see?

At some point earlier in my search, a link to the Template Literals page.

Do you have any supporting links, references, or citations?

No response

Do you have anything more you want to share?

I lucked into noticing https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals so I now know at least one of the items that ought to have appeared when I searched for $ (or '$' by itself, or both). The page I referenced is not appropriate to have a link to the Template Literals documentation, but the search function ought to include a note explaining "Your search query includes one or more characters we don't index. Instead of using that character, use its name. A list of characters we don't index and their names is available at ... ". Well, I could not find such a list, but $ does, indeed produce zero results, whereas "dollar sign" lead me directly to the Template Literals page (and "exclamation" and "asterisk" led me to the Value Definition Syntax page while ! and * yield zero search results).

My final proposal for solving this is the creation of a page which lists the symbols that are not indexed and causes that list to be presented in the popup search results whenever one of those symbols is typed into the search box.

teoli2003 commented 1 year ago

@schalkneethling Can you move this to mdn/yari?