diff options
Diffstat (limited to '')
-rw-r--r-- | _plugins/generate-pastebin-plaintext-alternate.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/_plugins/generate-pastebin-plaintext-alternate.rb b/_plugins/generate-pastebin-plaintext-alternate.rb index d85cacf..110a943 100644 --- a/_plugins/generate-pastebin-plaintext-alternate.rb +++ b/_plugins/generate-pastebin-plaintext-alternate.rb @@ -9,12 +9,13 @@ module Jekyll site.collections.each do |collection| _collection_name, collection_documents = collection collection_documents.docs.each do |document| - n = 1 - Renderer - .new(site, document) # create a renderer for the document - .run # generate the HTML string - .scan(CODE_BLOCK) # match all occurrences of regexp - .each do |code_block| # iterate on each match + if document.type != :slides + n = 1 + Renderer + .new(site, document) # create a renderer for the document + .run # generate the HTML string + .scan(CODE_BLOCK) # match all occurrences of regexp + .each do |code_block| # iterate on each match unhighlighted_code = code_block[0] # regexp only defines 1 match (only 1 parens) .gsub(/<span class=".*?">(.*?)<\/span>/m, '\1') content = CGI.unescapeHTML unhighlighted_code @@ -23,6 +24,7 @@ module Jekyll plain.content = content site.pages << plain n += 1 + end end end end |