Dyalog / MDAPL

The de facto standard for people who are looking to learn Dyalog APL from a book. This updated version is a work in progress.
https://mastering.dyalog.com/
Other
31 stars 7 forks source link

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

Open AleBeda opened 2 years ago

AleBeda commented 2 years ago

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 commented 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?

rodrigogiraoserrao commented 2 years ago

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

AleBeda commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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.