{"id":1922,"date":"2011-10-25T12:38:54","date_gmt":"2011-10-25T18:38:54","guid":{"rendered":"http:\/\/bililite.nfshost.com\/blog\/?p=1922"},"modified":"2012-08-05T21:27:25","modified_gmt":"2012-08-06T03:27:25","slug":"weird-bug-with-chili-and-firefox","status":"publish","type":"post","link":"https:\/\/bililite.com\/blog\/2011\/10\/25\/weird-bug-with-chili-and-firefox\/","title":{"rendered":"Weird bug with chili and Firefox"},"content":{"rendered":"<p>Update: I no longer (2012-08-05) use Chili, so this bug isn't relevant<\/p>\r\n<p><strong>Update: I haven't figured it out, but I did get a workaround. The bug is that any unmatched end of text leads to deleted characters in the middle of the text, so I added a line <code>$.chili.recipes[recipeName]._main.endoftext = {_match: \/$\/};<\/code> to the <code>downloadRecipe<\/code> method, and now the bug doesn't show up.<\/strong><\/p>\r\nI'm running Firefox 7.0.1 and I'm coming across a very strange bug in my syntax highlighter, <a href=\"http:\/\/noteslog.com\/chili\/\">chili<\/a>. It doesn't show up with any other browser (and I can't try older Firefox versions, with the auto-updating). I'm still working out the details, but it's erasing all the code from a string to 2 characters from the end. Thus:\r\n<pre><code>$('foo').show();<\/code><\/pre>\r\n<p>becomes<\/p>\r\n<pre><code class=\"language-javascript\">$('foo').show();<\/code><\/pre>\r\nIf you don't see a problem, great. If you do, switch to a different browser. Or figure out what's going on and let me know.\r\n<!--more-->\r\n<p>More experiments:<\/p>\r\n<pre><code>$('foo').show();<\/code><\/pre>\r\n<p>becomes<\/p><pre><code class=\"language-javascript\">$('foo').show();<\/code><\/pre>\r\n<pre><code>func('foo').show();<\/code><\/pre>\r\n<p>becomes<\/p><pre><code class=\"language-javascript\">func('foo').show();<\/code><\/pre>\r\n<pre><code>$(\"foo\").show({});<\/code><\/pre>\r\n<p>becomes<\/p><pre><code class=\"language-javascript\">$(\"foo\").show({});<\/code><\/pre>\r\n<pre><code>$(foo).show();<\/code><\/pre>\r\n<p>becomes<\/p><pre><code class=\"language-javascript\">$(foo).show();<\/code><\/pre>\r\n<pre><code>$('foo').show(x);<\/code><\/pre>\r\n<p>becomes<\/p><pre><code class=\"language-javascript\">$('foo').show(x);<\/code><\/pre>\r\n<pre><code>$('foo').show(\r\n);<\/code><\/pre>\r\n<p>becomes<\/p><pre><code class=\"language-javascript\">$('foo').show(\r\n);<\/code><\/pre>\r\n<pre><code>(foo).show();<\/code><\/pre>\r\n<p>becomes<\/p><pre><code class=\"language-javascript\">(foo).show();<\/code><\/pre>\r\n<pre><code>show();<\/code><\/pre>\r\n<p>becomes<\/p><pre><code class=\"language-javascript\">show();<\/code><\/pre>\r\n<pre><code>x() ;<\/code><\/pre>\r\n<p>becomes<\/p><pre><code class=\"language-javascript\">x() ;<\/code><\/pre>\r\n<pre><code>somechars);<\/code><\/pre>\r\n<p>becomes<\/p><pre><code class=\"language-javascript\">somechars);<\/code><\/pre>\r\n<pre><code>(somechars)<\/code><\/pre>\r\n<p>becomes<\/p><pre><code class=\"language-javascript\">(somechars)<\/code><\/pre>\r\n<pre><code>somechars;<\/code><\/pre>\r\n<p>becomes<\/p><pre><code class=\"language-javascript\">somechars;<\/code><\/pre>\r\n<pre><code>{somechars};<\/code><\/pre>\r\n<p>becomes<\/p><pre><code class=\"language-javascript\">{somechars};<\/code><\/pre>\r\n<pre><code>somechars<\/code><\/pre>\r\n<p>becomes<\/p><pre><code class=\"language-javascript\">somechars<\/code><\/pre>\r\n<p>But it's different for the different highlighters. The above was for javascript; this is HTML:<\/p>\r\n<pre><code>somechars<\/code><\/pre>\r\n<p>becomes<\/p><pre><code class=\"language-html\">somechars<\/code><\/pre>\r\n<p>and this is PDF:<\/p>\r\n<pre><code>somechars<\/code><\/pre>\r\n<p>becomes<\/p><pre><code class=\"language-pdf\">somechars<\/code><\/pre>","protected":false},"excerpt":{"rendered":"Update: I no longer (2012-08-05) use Chili, so this bug isn't relevant Update: I haven't figured it out, but I did get a workaround. The bug is that any unmatched end of text leads to deleted characters in the middle of the text, so I added a line $.chili.recipes[recipeName]._main.endoftext = {_match: \/$\/}; to the downloadRecipe [&hellip;]","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"_links":{"self":[{"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/posts\/1922"}],"collection":[{"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/comments?post=1922"}],"version-history":[{"count":21,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/posts\/1922\/revisions"}],"predecessor-version":[{"id":2552,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/posts\/1922\/revisions\/2552"}],"wp:attachment":[{"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/media?parent=1922"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/categories?post=1922"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/tags?post=1922"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}