Skip to content

Commit

Permalink
☎ prevent safari from detecting phone numbers (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
hf-kklein authored Apr 20, 2022
1 parent 49453a5 commit 8b1e891
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func performRequest(r http.Handler, method, path string, body io.Reader) *httpte
}

func (s *Suite) Test_MaLo_Endpoint_Returns_Something_Like_A_MaLo() {
maloPattern := regexp.MustCompile(`\d{10}<span [^>]+>\d</span>`)
maloPattern := regexp.MustCompile(`<span>\d{10}</span><span [^>]+>\d</span>`)
router := main.NewRouter()
response := performGetRequest(router, "/api/generate-malo-id")
then.AssertThat(s.T(), response.Code, is.EqualTo(http.StatusOK))
Expand Down
1 change: 1 addition & 0 deletions cmd/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ body {
h1 {
font-size: 800%;
color: #6eb52c;
letter-spacing: -4px; /* to prevent line breaks between the ::after emoji and the malo id*/
}

.checksum {
Expand Down
18 changes: 16 additions & 2 deletions cmd/static/templates/index.tmpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,27 @@
<meta name="description" content="Zufällig generierte MaLo-IDs mit gültiger Prüfziffer">
<meta name="keywords" content="MaLo, MaLo-ID, Marktlokation, Test, Test-MaLo, Marktlokationsid">
<meta http-equiv="cache-control" content="no-cache"/>
<!-- prevent safari from formatting numbers with good intentions: https://stackoverflow.com/a/30426346/10009545 -->

This comment has been minimized.

Copy link
@hf-kklein

hf-kklein Apr 21, 2022

Author Contributor
<meta name="format-detection" content="telephone=no"/>
<link rel="stylesheet" href="/api/style">
<link rel="icon" type="image/x-icon" href="/api/favicon">
</head>
<body class="whiteBackground">
<!--
________________________________________
< Hey, kennst du schon unsere Jobangebote? >
----------------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
https://www.hochfrequenz.de/karriere/stellenangebote/full-stack-entwickler/
-->
<div id="content">
<h1 class="{{ .division }}" title="Eine zufällige MaLo-ID mit gültiger Prüfziffer (Sparte {{ .division }})">{{
.maLoIdWithoutChecksum }}<span class="checksum" title="Prüfziffer {{ .checksum }}">{{ .checksum }}</span></h1>
<h1 class="{{ .division }}" title="Eine zufällige MaLo-ID mit gültiger Prüfziffer (Sparte {{ .division }})"><span>{{
.maLoIdWithoutChecksum }}</span><span class="checksum" title="Prüfziffer {{ .checksum }}">{{ .checksum }}</span>
</h1>
</div>
<div id="footer">powered by <a href="https://hochfrequenz.de/">
hochfrequenz
Expand Down

0 comments on commit 8b1e891

Please sign in to comment.