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

Convert HTML attributes containing emoji unicode #130

Open
lentschi opened this issue Apr 13, 2020 · 0 comments
Open

Convert HTML attributes containing emoji unicode #130

lentschi opened this issue Apr 13, 2020 · 0 comments

Comments

@lentschi
Copy link

When I try to convert the following HTML with your lib's replace_unified method:

<a title="Hello πŸ§›β€β™€οΈ!">Hello</a> πŸ‘Œ πŸ§›β€β™€οΈ πŸ‘Œ!

... it produces the following (invalid) HTML:

<a title="Hello <span class="emoji emoji-sizer" style="background-image:url(/emoji-data/img-apple-64/1f9db-200d-2640-fe0f.png)" data-codepoints="1f9db-200d-2640-fe0f"></span>!">
  Hello
</a>
<span class="emoji emoji-sizer" style="background-image:url(/emoji-data/img-apple-64/1f44c.png)" data-codepoints="1f44c"></span>
<span class="emoji emoji-sizer" style="background-image:url(/emoji-data/img-apple-64/1f9db-200d-2640-fe0f.png)" data-codepoints="1f9db-200d-2640-fe0f"></span>
<span class="emoji emoji-sizer" style="background-image:url(/emoji-data/img-apple-64/1f44c.png)" data-codepoints="1f44c"></span>!

(note the span in the title attribute)

Am I doing something wrong or does your library just not support HTML input? If the latter is the case, you could maybe mention in the README that it just supports text that has been html escaped prior to conversion or even do the escaping within the library. (Though that would be a breaking change.)

Btw. for me the expected behavior would be to leave the title attribute untouched as it cannot contain images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant