diff options
author | EuAndreh <eu@euandre.org> | 2020-11-14 09:23:30 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2020-11-14 09:29:31 -0300 |
commit | 930c686626bec74349a655589632f80485abbe92 (patch) | |
tree | 00fafc75e6b1b44f12098b70122ee676857e8794 /_plugins | |
parent | Replace links to git.sr.ht/~euandreh to git.euandreh.xyz (diff) | |
download | euandre.org-930c686626bec74349a655589632f80485abbe92.tar.gz euandre.org-930c686626bec74349a655589632f80485abbe92.tar.xz |
Indent code of plaintext generator
Diffstat (limited to '_plugins')
-rw-r--r-- | _plugins/generate-pastebin-plaintext-alternate.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/_plugins/generate-pastebin-plaintext-alternate.rb b/_plugins/generate-pastebin-plaintext-alternate.rb index 110a943..5ab059d 100644 --- a/_plugins/generate-pastebin-plaintext-alternate.rb +++ b/_plugins/generate-pastebin-plaintext-alternate.rb @@ -16,14 +16,14 @@ module Jekyll .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 - name = "#{document.url}.#{n}.txt" - plain = PageWithoutAFile.new(site, site.source, "", name) - plain.content = content - site.pages << plain - n += 1 + unhighlighted_code = code_block[0] # regexp only defines 1 match (only 1 parens) + .gsub(/<span class=".*?">(.*?)<\/span>/m, '\1') + content = CGI.unescapeHTML unhighlighted_code + name = "#{document.url}.#{n}.txt" + plain = PageWithoutAFile.new(site, site.source, "", name) + plain.content = content + site.pages << plain + n += 1 end end end |