-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
interactive examples: line numbers and code overlaps #976
Comments
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
I can't find the report now, but I wonder if this is an intermittent issue we see in interactive examples where the line numbers overlap the first couple of characters of the code. It turns out I can reproduce this in Chrome if I:
@cjarmada , is this what you are seeing? This has been reported before but was closed because noone could figure out what was causing it. But if this is your problem I think we should transfer this issue to Yari, so we can have another go at fixing it! |
No wonder I couldn't find it, it was from Kuma days: mdn/kuma#6310. |
Yes, this was it.
…On Tue, May 3, 2022 at 7:52 AM wbamberg ***@***.***> wrote:
I can't find the report now, but I wonder if this is an intermittent issue
we see in interactive examples where the line numbers overlap the first
couple of characters of the code. It turns out I can reproduce this in
Chrome if I:
- open a page, like say
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice
- from the sidebar, "open in new tab" a new page, like
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/copyWithin,
so it opens in the background
- switch to that new tab
[image: Screen Shot 2022-05-02 at 4 48 14 PM]
<https://user-images.githubusercontent.com/432915/166343677-1d9b1285-e6f8-419c-b672-5e4c9ccf5279.png>
@cjarmada <https://github.com/cjarmada> , is this what you are seeing?
This has been reported before but was closed because noone could figure
out what was causing it.
—
Reply to this email directly, view it on GitHub
<mdn/yari#6152>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AXGP6NKI5FWMLHVBIOIORTDVIBTCDANCNFSM5U3FMIMA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Great! Since this is a platform issue, I'm transferring it to mdn/yari. |
Unfortunately I cannot reproduce the issue following those steps with Chrome 101 on Mac OS.
|
Duplicate of #742. |
Thanks @wbamberg! I was able to reproduce it now, but only after disabling MDN Offline. It looks like a CodeMirror bug, which doesn't set the And there are indeed two corresponding upstream bugs: |
I am using this script in Tampermonkey now, to fix the issue on my end, and thought it might be worth suggesting that you'll implement the same workaround for everyone until the upstream issues have been resolved: gist.github.com/schockocraft/mdn-fix-js-code-examples.js If you don't wanna do this, i hope anyone who is annoyed by it will find the link here to use it for themselfes :D |
This issue has been fixed, after updating CodeMirror to version 6. Thank you for reporting it. |
Summary
Sometimes the line numbers of interactive examples overlap with the code.
Details
See this comment.
See also
Original description by @cjarmada
MDN URL
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat
What specific section or headline is this issue about?
Array.prototype.concat()
What information was incorrect, unhelpful, or incomplete?
the demo is altered/bug
What did you expect to see?
a structured explanation
Do you have any supporting links, references, or citations?
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/concat
Do you have anything more you want to share?
No response
MDN metadata
Page report details
en-us/web/javascript/reference/global_objects/array/concat
The text was updated successfully, but these errors were encountered: