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

Certain numbers are expanded as phone numbers with Safari on the iPad #19

Open
AleBeda opened this issue Jan 25, 2022 · 6 comments
Open
Labels
bug Something isn't working

Comments

@AleBeda
Copy link

AleBeda commented Jan 25, 2022

Reading the book with Safari on the iPad causes certain numbers (e.g. sequences of 7 or 8 digits, even if interspersed with spaces) to be recognized as phone numbers and be highlighted in blue as hyperlinks, which is very annoying.
Apparently there is no way to disable this phone number expansion on the client side, but there seems to be a way to disable it on the server side, although I haven't tried this: https://stackoverflow.com/questions/226131/how-to-disable-phone-number-linking-in-mobile-safari

IMG_0016

Note that this problem does not seem to occur with other Jupyter books (cf. https://xpqz.github.io/learnapl/intro.html and https://xpqz.github.io/cultivations/Intro.html).

@rodrigogiraoserrao
Copy link
Contributor

Hey, thanks for filing this issue! I'll try to understand what/if there is a difference between this book and xpqz's, and look at the possible fix you linked.

Have you noticed if xpqz's books do not exhibit that behaviour in code outputs with 9 or more digits? For example, right in the beginning of this section there are 10 digits. Do those get highlighted?
What about in here?

@rodrigogiraoserrao
Copy link
Contributor

rodrigogiraoserrao commented Feb 1, 2022

(For reference, the screenshot in the original issue is from “Data and Variables” → “Indexing” → “Array Indexing”, here.)

@AleBeda
Copy link
Author

AleBeda commented Feb 1, 2022

Rodrigo, in fact it appears that xpqz's book also has the same problem with iOS creating blue hyperlinks for sequences of numbers that it mistakenly guesses to be phone numbers. I speculate that this might happen if there are at least some 2-digit numbers but not if there only 1-digit numbers. I am attaching some more screenshots both from xpqz's book and one from Mastering Dyalog APL.
IMG_0AE8928C1F3A-1
IMG_D82BC8E593D8-1
IMG_48977B83049C-1
IMG_A021F53D72FB-1

@xpqz
Copy link

xpqz commented Feb 2, 2022

Adding

<meta name="format-detection" content="telephone=no">

as the first line of the generated index.html file fixes the issue globally. Not figured out how/if this can be done from jupyter-book's config files.

@rodrigogiraoserrao rodrigogiraoserrao added the bug Something isn't working label Feb 2, 2022
@rodrigogiraoserrao
Copy link
Contributor

Going through the Jupyter Book docs, Sphinx docs, and some other things I googled, it seems like what we want is awfully similar to the meta directive that Sphinx provides, except we can't set this through the _config.yml file.

This is backed up by issue 6089 of the Sphinx repo where a user wanted a way to specify default values to some meta tags, instead of having to use the meta directive on each file.

@xpqz
Copy link

xpqz commented Feb 2, 2022

Someone suggested adding a file _layouts/layout.html like so:

{% extends "layout.html" %}
{% block extrahead %}
    <meta name="format-detection" content="telephone=no">
{% endblock %}

but that didn't seem to do anything for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants