-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
Escaped characters inside <noscript>
on Safari
#107
Comments
Hi, thanks for reporting! I've encountered a similar issue in no longer used IE versions but didn't know Safari suffers a similar problem.
|
Yeah, I'm using In case JS is enabled, I'm parsing the contents of the Here's a screenshot showing the contents of |
I see. Thanks for the explanation! I would maybe consider avoiding the possibly unnecessary processing of It seems like a really specific issue (only Safari when processing How about we "don't fix" this issue and add the issue into the Common Issues for future reference? |
It's actually a custom masonry plugin I wrote that handles layout in a different way than any other implementation (no absolute positioning and resize watching). The reason I use Sound good to me. Do you want me to open a PR with the notes? |
That's pretty cool! Would love to see the outcome if you have an example somewhere. I always hated that long list of elements with absolute positions... How about this? |
Looks good to me! Here's a gist where I dumped the different pieces that make it work: https://gist.github.com/hacknug/4b0461240054a9cdcad28e427a3014a8 I also just discovered there a react/vue component that does pretty much the same: |
I've encountered a weird issue on Safari where special characters inside a
<noscript>
tag get escaped when using swup (first load works fine).The issue seems to be related to how
.innerHTML
works and I was able to work around it using.innerText
instead (.textContent
seems to work too). This is most probably the line causing the issue: https://github.com/gmrchk/swup/blob/master/src/modules/getDataFromHtml.js#L6I was trying to do some custom layout with elements inside this
<noscript>
when JavaScript is available, which will fallback to a simple flexbox-wrapped grid layout.Here's the code I wrote that solves the issue. Note the use of a helper function named
decodeHTML
that helps getting those escaped characters unescaped again.The text was updated successfully, but these errors were encountered: