jekyll-webmention_io icon indicating copy to clipboard operation
jekyll-webmention_io copied to clipboard

build failure due to invalid utf-8 in source comments

Open tthef opened this issue 11 months ago • 3 comments

First of all thanks for this, this a very useful pluging.

I can run my jekyll build with webmetion_io ok localy, but when it runs on the cloudflare Pages service, it fails with 'source sequence is illegal/malformed utf-8 (JSON::GeneratorError)'; I believe this is because at two places in comments a 'smart' apostrophe is encoded as \xE2\x80\x99, which is not valid JSON (\x is not a valid escape in JSON), but I have no idea at which point does the apostrope become encoded this way. But the source locations are,

// If there\xE2\x80\x99s a generic, add it there too at https://github.com/aarongustafson/jekyll-webmention_io/blob/7d14638db4080b55d36f5d68532378d8d272ad07/lib/jekyll/assets/JekyllWebmentionIO.js#L192 and

* A re-tooling of Aaron Parecki\xE2\x80\x99s recommended JS for using the WebMention.io API at https://github.com/aarongustafson/jekyll-webmention_io/blob/7d14638db4080b55d36f5d68532378d8d272ad07/lib/jekyll/assets/_utils.js#L4

tthef avatar Dec 21 '24 17:12 tthef

The JSONs originates in the uglifier, but I think it is just wrapping what is pipped to it from this plugin, which AFAICT comes straight out of file io.

For me the easiest workaround is to manually deploy the js file, so that I don't have to run uglifier at on the target.

tthef avatar Dec 27 '24 08:12 tthef

Pushed a fix for this to main. Let me know if it's resolved for you!

fancypantalons avatar Jan 10 '25 04:01 fancypantalons

Would you be OK to release the fix?

l0b0 avatar Jun 18 '25 06:06 l0b0

I am terribly sorry for the late reply on this! Life is life-ing over here, as it tends to do.

I'll aim to get this released over the next week or so!

fancypantalons avatar Jul 14 '25 13:07 fancypantalons

Well, I absolutely lied about that timeline, but I finally pushed 4.1.0 that includes this plus a few other fixes that have accumulated over time.

fancypantalons avatar Aug 31 '25 16:08 fancypantalons