Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Yahoo | GANGA] HTML comments partially removed #95

Open
husseinalhammad opened this issue Jul 1, 2021 · 3 comments
Open

[Yahoo | GANGA] HTML comments partially removed #95

husseinalhammad opened this issue Jul 1, 2021 · 3 comments
Labels
Gmail Webmail, iOS and Android apps Yahoo Webmail, iOS and Android apps

Comments

@husseinalhammad
Copy link

I initially ran into this on Yahoo (web and Android), but upon further testing I found a similar behaviour on Gmail Android with a non-Gmail account.

Both Yahoo and Gmail attempt to remove HTML comments. However, Yahoo partially removes HTML comments if -> (single dash) is within the comment, while GANGA (Android) partially removes HTML comments if 2 occurrences of -> is within the comment. This happens even if the HTML comment is technically valid.

HTML comments syntax

https://html.spec.whatwg.org/multipage/syntax.html#comments

Optionally, text, with the additional restriction that the text must not start with the string ">", nor start with the string "->", nor contain the strings "", or "--!>", nor end with the string "<!-".

Yahoo

The following is a valid HTML comment, however Yahoo assumes it ends at ->:

<!--
  some comment -> text starting here is visible on Yahoo
-->

GANGA

The following is also a valid HTML comment, however GANGA (Android at least) assumes it ends at the second ->:

<!--
  another comment -> here -> text starting here is visible on GANGA
-->
@hteumeuleu hteumeuleu added Gmail Webmail, iOS and Android apps Yahoo Webmail, iOS and Android apps labels Jul 1, 2021
@M-J-Robbins
Copy link
Contributor

M-J-Robbins commented Jul 1, 2021

Oh wow this is really cool so we can use conditional comments for Yahoo and GANGA

<!--Yahoo-> 
<p style="background:red;color:white;font-size:50px;">You are using Yahoo or AOL</p>
<!yahoo-->
<!--Yahoo-GANGA-> 
<p style="background:green;color:white;font-size:50px;">You are using Yahoo, AOL or GANGA</p>
<!yahoo-GANGA-->

(the - between Yahoo and GANGA here is what's making it work).

<!--GANGA->
<div style="display:none"> -> 
<p style="background:green;color:white;font-size:50px;">GANGA</p>
<!GANGA--><!--</div><! -->

@husseinalhammad
Copy link
Author

@M-J-Robbins I was annoyed when I ran into this, but I like how you turned this into "we can now use this to target these clients"!

@matthieuSolente
Copy link

Your discovery allows me to swap image even for yahoo-Ganga, which is a little revolution for me !! haha..https://codepen.io/matthieuSolente/pen/vYmKyZe thanks guys !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gmail Webmail, iOS and Android apps Yahoo Webmail, iOS and Android apps
Projects
None yet
Development

No branches or pull requests

4 participants