Closed Bug 1418133 Opened 7 years ago Closed 7 years ago

Link parser incorrectly identifies some links as new

Categories

(developer.mozilla.org Graveyard :: General, enhancement, P1)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: shobson, Unassigned)

References

Details

(Keywords: in-triage)

In the side bar on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce the "Standard build-in objects" link has class="new" on it but clicking the link takes you to a real page not a 404 or prompt to create a new page.
See Also: → 778478
The link is to: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ The link should be to: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects The KS macros JSRef and L10n-JavaScript should be changed to insert the correct link.
Keywords: in-triage
Priority: -- → P1
This was fixed with https://github.com/mdn/kumascript/pull/429 but I have not a) re-rendered all JS pages b) checked with this issue is present with other macros as well.
I've re-rendered the 4736 pages that use the JSRef macro. I used a Django shell script, but I think I can adjust it into utils and management commands to re-render pages for this kind of work in the future [1]. There are another 4373 English pages with missing links in the sidebar, and 3414 not in the Archive. Spot checking, these seem legitimate. For example, the sidebar for the HTTP status "200 OK" [3] contains a missing link to "Resources and URIs" [4], which is indeed a new page. It's also a submenu expansion link, so maybe the destination page isn't supposed to exist. I can provide a list of these pages if desired, but I think this is the new code working as intended. There are pages that appear to be experiments, such as "User:wbamberg/Examples_on_top/Array.prototype.push():v1" [5], which have the missing link due to the trailing slash. They have a copied version of the JSRef output, so that the sidebar looks as expected for the experiments. The other pages with the "real" trailing slash issue are WebAssembly docs [6]. The WebAssemblySidebar macro [7] needs a similar fix and regeneration, and then I think we can close this issue. [1] https://gist.github.com/jwhitlock/43e34e07bef8c3f1863e91f076778ca6 [2] Document.objects.filter(locale='en-US', quick_links_html__contains='class="new"').exclude(slug__startswith='Archive/') [3] https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200 [4] https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Resources_and_URIs [5] https://developer.mozilla.org/en-US/docs/User:wbamberg/Examples_on_top/Array.prototype.push():v1 [6] https://developer.mozilla.org/en-US/docs/WebAssembly [7] https://github.com/mdn/kumascript/blob/master/macros/WebAssemblySidebar.ejs
Commit pushed to master at https://github.com/mdn/kumascript https://github.com/mdn/kumascript/commit/0919eb59e40022e0fd40be3a54d6afef48e6f136 WebAssemblySidebar: Remove trailing slash Remove the trailing slash from /en-US/docs/WebAssembly, to help with bug 1418133.
The new WebAssembly macro is deployed, and the users of the page are regenerated. I wrote some code to find any more sidebars with this issue: from pyquery import PyQuery as pq docs = Document.objects.filter(locale='en-US', quick_links_html__contains='class="new"').exclude(slug__startswith='Archive/') docs_limited = docs.only('id', 'quick_links_html') for doc in docs_limited: sb_links = pq(doc.quick_links_html).find('a') hrefs = [link.attrib.get('href', '') for link in sb_links] bad_hrefs = [href for href in hrefs if href.endswith('/') and not href.startswith('http')] if bad_hrefs: print(doc.get_full_url()) All of the remaining pages are from the interactive examples project: https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/@@iterator https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/@@species https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/concat https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/copyWithin https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/entries https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/every https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/fill https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/filter https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/find https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/findIndex https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/forEach https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/from https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/includes https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/indexOf https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/isArray https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/join https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/keys https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/lastIndexOf https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/length https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/map https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/of https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/pop https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/prototype https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/push https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/reduce https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/reduceRight https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/reverse https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/shift https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/slice https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/some https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/sort https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/splice https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/toLocaleString https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/toSource https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/toString https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/unshift https://developer.mozilla.org/en-US/docs/Experiment:StaticExamplesOnTop/JavaScript/Array/values https://developer.mozilla.org/en-US/docs/User:schalkneethling:push https://developer.mozilla.org/en-US/docs/User:wbamberg/Examples_on_top/Array.prototype.indexOf https://developer.mozilla.org/en-US/docs/User:wbamberg/Examples_on_top/Array.prototype.indexOf():v2 https://developer.mozilla.org/en-US/docs/User:wbamberg/Examples_on_top/Array.prototype.map https://developer.mozilla.org/en-US/docs/User:wbamberg/Examples_on_top/Array.prototype.map():v2 https://developer.mozilla.org/en-US/docs/User:wbamberg/Examples_on_top/Array.prototype.push https://developer.mozilla.org/en-US/docs/User:wbamberg/Examples_on_top/Array.prototype.push():v1 https://developer.mozilla.org/en-US/docs/User:wbamberg/Examples_on_top/Array.prototype.push():v2 https://developer.mozilla.org/en-US/docs/User:wbamberg/Examples_on_top/Array.prototype.push():v2.2 https://developer.mozilla.org/en-US/docs/User:wbamberg/Examples_on_top/Array.prototype.push():v3 https://developer.mozilla.org/en-US/docs/User:wbamberg/Examples_on_top/Array.prototype.push()_-_version_1 https://developer.mozilla.org/en-US/docs/User:wbamberg/Examples_on_top/Array.prototype.slice https://developer.mozilla.org/en-US/docs/User:wbamberg/Examples_on_top/Array.prototype.slice():v1 https://developer.mozilla.org/en-US/docs/User:wbamberg/Examples_on_top/Array.prototype.slice():v2 https://developer.mozilla.org/en-US/docs/User:wbamberg/Examples_on_top/Array.prototype.slice():v2.1 https://developer.mozilla.org/en-US/docs/User:wbamberg/Examples_on_top/SheppyJSExample1 https://developer.mozilla.org/en-US/docs/User:wbamberg/Examples_on_top/_Array.prototype.push()_-_version_2 I think I can call this task done.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
See Also: → 1413289
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.