{"id":3030,"date":"2013-12-09T10:53:45","date_gmt":"2013-12-09T16:53:45","guid":{"rendered":"http:\/\/bililite.com\/blog\/?p=3030"},"modified":"2013-12-09T10:53:45","modified_gmt":"2013-12-09T16:53:45","slug":"simpler-line-numbering-plugin-for-prism","status":"publish","type":"post","link":"https:\/\/bililite.com\/blog\/2013\/12\/09\/simpler-line-numbering-plugin-for-prism\/","title":{"rendered":"Simpler line numbering plugin for Prism"},"content":{"rendered":"<p>Looking back at my <a href=\"http:\/\/bililite.com\/blog\/2012\/08\/05\/line-numbering-plugin-for-prism\/\" title=\"Line Numbering Plugin for Prism\">line numbering plugin for Prism<\/a>, I realized that it's working too hard by manipulating the DOM. <a href=\"http:\/\/prismjs.com\">Prism<\/a> works by string manipulation anyway, so there's no harm in using that to wrap the lines rather than searching through elements. The <a href=\"\/blog\/wp-content\/plugins\/syntaxhighlightchooser\/prism\/prism.linenumber.js\">code<\/a> is now only 6 lines long. It still uses CSS and <code class=\"language-css\" >::before<\/code> pseudoelements to show the line numbers.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Looking back at my line numbering plugin for Prism, I realized that it's working too hard by manipulating the DOM. Prism works by string manipulation anyway, so there's no harm in using that to wrap the lines rather than searching through elements. The code is now only 6 lines long. It still uses CSS and [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,20],"tags":[],"_links":{"self":[{"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/posts\/3030"}],"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=3030"}],"version-history":[{"count":1,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/posts\/3030\/revisions"}],"predecessor-version":[{"id":3033,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/posts\/3030\/revisions\/3033"}],"wp:attachment":[{"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/media?parent=3030"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/categories?post=3030"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bililite.com\/blog\/wp-json\/wp\/v2\/tags?post=3030"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}