fix(site): stop Cloudflare rewriting the CDN snippet as an email address - #41
Merged
Conversation
The landing page's install snippet went live reading https://cdn.jsdelivr.net/npm/@h4md1/[email protected]/dist/... Cloudflare proxies h4md1.fr, and its Email Address Obfuscation feature matched "visual-image-tool@0.3.0" as an address, replacing it with a mailto-decoding <a> and injecting its email-decode script. Anyone copying the CDN line got a dead URL — the one snippet on the page whose entire job is to be copied. It only appeared once the version was pinned: the previous "@0.2" has a single dot and didn't look domain-like enough to match. Wraps the block in Cloudflare's documented email_off opt-out, which works from the page without touching the dashboard. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Caught while verifying the deploy of #40.
The bug
The install snippet went live on h4md1.fr/visual-image-tool/ reading:
Cloudflare proxies
h4md1.fr, and its Email Address Obfuscation feature matchedvisual-image-tool@0.3.0as an email address — replacing it with amailto-decoding<a class="__cf_email__">and injectingemail-decode.min.js.So the one snippet on the page whose entire job is to be copied produced a dead URL.
The
gh-pagesbranch was byte-identical to the local file; the rewrite happens at Cloudflare's edge, after GitHub serves it. Diffing served-vs-deployed is what surfaced it:It only appeared once the version was pinned — the previous
@0.2has a single dot and didn't look domain-like enough to match.The fix
Wraps the block in Cloudflare's documented
<!--email_off-->opt-out, which works from the page itself with no dashboard access.h4md1.fr/QuickToss/was checked and is unaffected — zero__cf_email__occurrences, no email-shaped text on it.🤖 Generated with Claude Code