I agree with Kerri that you need semicolons at the ends of your entities.

But to avoid multi-level escaping confusion altogether, use JavaScript string literal unicode escapes in your JavaScript code, like so:

```html
<a href="javascript:doEmoji('\u{1F536}')">&#x1F536;</a> &nbsp;
```

Hope this helps.
-sam

On 17 Feb 2020, at 10:13, jgill wrote:

Hi,

I'm writing a web page that inserts specific emoji into a text box with
Javascript.

<a href="javascript:doEmoji('&#x1F536')">&#x1F536</a> &nbsp;

This works perfectly as expected but BBEdit is insisting that I need to change the ampersands to &amp; and if I format the page, it changes all my
ampersands to &amp; and breaks the Javascript.

How can I write this to make the syntax checker happy?

Tia.

Joe

--
This is the BBEdit Talk public discussion group. If you have a feature request or need technical support, please email "[email protected]" rather than posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/bbedit/ef2e9d15-222e-4aab-b8bc-686a8d8a40d4%40googlegroups.com.



--
This is the BBEdit Talk public discussion group. If you have a feature request or need 
technical support, please email "[email protected]" rather than posting here. 
Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/896D4BAE-C688-4B53-B726-CA0270508237%40munkynet.org.

Reply via email to