{"id":14410245,"date":"2021-05-07T06:45:43","date_gmt":"2021-05-07T06:45:43","guid":{"rendered":"https:\/\/wordpress.org\/support\/?post_type=topic&#038;p=14410245"},"modified":"2021-05-07T06:47:07","modified_gmt":"2021-05-07T06:47:07","slug":"trailing-comma-breaks-else-clause-highlighting","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/trailing-comma-breaks-else-clause-highlighting\/","title":{"rendered":"Trailing comma breaks else-clause highlighting"},"content":{"rendered":"<p>The following Python code <strong>is highlighted correctly<\/strong> when using <code>highlight.js<\/code> directly on, say, <a href=\"http:\/\/jsfiddle.net\/toubia95\/bDW8H\/\">JSFiddle<\/a>, but, on my blog, the <code>else<\/code>, <code>continue<\/code>, and <code>break<\/code> get grayed-out when a comment looms over them. (They come back to life if I remove the comment, though, so I can rule out a &#8220;config issue&#8221; per se.)<\/p>\n<pre><code>\nx = default_value\nfor key, values in dict_of_sets:\n\tfor value in values:\n\t\tif predicate(key, value):\n\t\t\tx = value\n\t\t\tbreak  # THIS BREAKS BOTH LOOPS!\n\telse:\n\t\tcontinue\n\tbreak\n<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-14410245","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14410245","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":2,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14410245\/revisions"}],"predecessor-version":[{"id":14410255,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/14410245\/revisions\/14410255"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=14410245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}