Open AleBeda opened 2 years ago
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?
(For reference, the screenshot in the original issue is from “Data and Variables” → “Indexing” → “Array Indexing”, here.)
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.
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.
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.
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.
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
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).