Skip to content
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

Fixed broken code highlight on Safari of iOS 15.7.8 #2972

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Dieken
Copy link
Contributor

@Dieken Dieken commented Feb 14, 2024

On iOS, the "type A */" is rendered as "type A //", seems highlight.js is incompatible with iOS Safari, wrongly replaces "*/" with "//".

I'm not able to find the root cause, thus change to inline comment to bypass the issue.

@Dieken
Copy link
Contributor Author

Dieken commented Feb 14, 2024

Upload the screenshot to show the issue.

image

@bishabosha
Copy link
Member

bishabosha commented Feb 14, 2024

im not sure what your original comment means, e.g. here is what I see on iOS (it is iOS 17.2.1):

IMG_A62D691D6578-1

@Dieken
Copy link
Contributor Author

Dieken commented Feb 14, 2024

im not sure what your original comment means, e.g. here is what I see on iOS (it is iOS 17.2.1):

So it's a bug in webkit engine of iOS 15.7.8, I tried Chrome on iOS, same issue as the screenshot above, the trailing "*/" is rendered as "//" and the whole code snippet is rendered as comment.

Although it's not fault of scala docs, I suggest merging this patch, iOS 17.2.1 can't be installed on my poor old iPhone 7P: https://support.apple.com/guide/iphone/models-compatible-with-ios-17-iphe3fa5df43/ios

On iOS, the "type `A` */" is rendered as "type `A` //", it's probably a bug
in webkit engine of iOS 15.7.8, newer iOS doesn't have this issue, see
scala#2972 (comment)

I'm not able to find the root cause, thus change to inline comment to bypass
the issue for my old iPhone 7 Plus.
@Dieken
Copy link
Contributor Author

Dieken commented Feb 23, 2024

Any more comment?

@bishabosha
Copy link
Member

bishabosha commented Feb 23, 2024

there are 175 of occurrences of */ in .md files in the docs, including more non-english translations of this page. Did you see any other occurrences across the site that had the same issue?

@Dieken
Copy link
Contributor Author

Dieken commented Feb 23, 2024

there are 175 of occurrences of */ in .md files in the docs, including more non-english translations of this page. Did you see any other occurrences across the site that had the same issue?

I read tour of scala and scala 3 book in English, found that only strange code highlight, I wasn’t able to find the root cause, I guess it’s an incompatibility of Safari on iOS 15.7.8 with highligh.js on that special code snippet.

BTW, when I copy the wrongly rendered text, it’s really converted into “//“ that means wrong Scala syntax.

Very weird issue, this PR is just a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants