Skip to content

links/tel-mailto: distinguish optional German trunk-prefix notation from a destination mismatch #663

Closed

Description

@deniskern

Summary. squirrel 0.0.108 reports a destination mismatch for <a href="tel:+4960616309800">+49 (0)6061 630 980 0</a>. In this German display convention, (0) indicates the national trunk prefix, so the intended destination is the number in the href. However, this mixed notation is not recommended by ITU-T E.123 §7.2. Formatting advice is defensible; please distinguish it from a genuinely different destination number.

Data. one-dot.de header link below; the rule fires on every page that carries the header (20 of 20 sampled pages).

Repro. Save as tel.html:

<!doctype html><html lang="de"><head><meta charset="utf-8"><title>Tel link fixture page</title></head>
<body><a href="tel:+4960616309800">+49 (0)6061 630 980 0</a></body></html>

Serve tel.html with the following command. /control.html serves the same document with only the display-text (0) removed; the href remains unchanged.

node -e 'const fs=require("node:fs");const html=fs.readFileSync("tel.html","utf8");require("node:http").createServer((q,r)=>{r.setHeader("Content-Type","text/html; charset=utf-8");r.end(q.url==="/control.html"?html.replace("+49 (0)6061","+49 6061"):html)}).listen(8765,"127.0.0.1")'
squirrel --version
squirrel audit http://127.0.0.1:8765/ --http --refresh -m 1 -f json -o optional-prefix.json --rule-include links/tel-mailto
squirrel audit http://127.0.0.1:8765/control.html --http --refresh -m 1 -f json -o control.json --rule-include links/tel-mailto

Actual (spark-onedot, 2026-10-11, squirrel 0.0.108): tel-mismatch, warn, 1 tel link(s) have mismatched phone number in href vs display text. Control: the same link with display text +49 6061 630 980 0 passes.

Expected: distinguish a non-recommended display format from a different destination number. In this German example, (0) represents the national trunk prefix, which is omitted after +49; the intended destination matches the href. If the display notation is flagged, report it as formatting advice, for example: Avoid the optional trunk prefix in international display notation; use +49 6061 630 980 0. Any normalization must be country-aware and limited to display-text interpretation; do not remove zeros from the href or apply this transformation to every country code.

References: ITU-T E.123 §§2.8, 7.2, RFC 3966 §8.

Acceptance Criteria

  • tel:+4960616309800 with display text +49 (0)6061 630 980 0 no longer reports a destination mismatch.
  • That display notation is reported as formatting advice, with a message that suggests the E.123 form, at a lower level than a mismatch.
  • A display number that is a genuinely different destination still reports tel-mismatch.
  • Only the display text is interpreted, and only for country codes where a trunk prefix applies; the href is never changed, and other countries' zeros are not dropped.
  • Tests cover the German example, a different number, and a non-trunk-prefix country.

Activity

  1. added
    enhancement
    P3
    rules
    size: S
    on Oct 11, 2026
  2. nc9 commented on Oct 11, 2026

    @nc9
    Contributor

    Thanks Denis. Triaged as an enhancement (P3), size S, area rules. The rule currently compares digits of the display text with the href and has a trunk-zero allowance, so the (0) notation needs a country-aware display-text interpretation, as you describe. I added acceptance criteria. The href is never changed, and a different destination number keeps tel-mismatch.

  3. nc9 commented on Oct 12, 2026

    @nc9
    Contributor

    Fixed in # and merged to main. Every acceptance criterion is met per the PR description, with before and after evidence from the CLI on local fixtures, tests that fail on the old code, and review comments triaged. Criteria ticked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3enhancementrulessize: S

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions