aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Mathis <brandon@imathis.com>2011-07-28 15:21:34 -0400
committerBrandon Mathis <brandon@imathis.com>2011-07-28 15:21:46 -0400
commita516c773d14e9af15421a8eb33f68cb5e30b0336 (patch)
treea4d93dffa09003749da0790af42c87be4eca24b7
parent7209aaf64c70fdc254b7c3da98703b89296a61db (diff)
downloadmy_new_personal_website-a516c773d14e9af15421a8eb33f68cb5e30b0336.tar.xz
my_new_personal_website-a516c773d14e9af15421a8eb33f68cb5e30b0336.zip
improved replacement filters for textile markup on github backtick codeblocks, added comment to show regular HTML support
-rw-r--r--plugins/octopress_filters.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/octopress_filters.rb b/plugins/octopress_filters.rb
index 8c9367ba..21c24eed 100644
--- a/plugins/octopress_filters.rb
+++ b/plugins/octopress_filters.rb
@@ -36,10 +36,11 @@ module OctopressFilters
# Textile support
input = input.gsub /<p>`{3}\s(\w+)<br\s*\/>\n(.+?)`{3}<\/p>/m do
lang = $1
- str = $2.gsub(/^\s{4}/, '').gsub(/<br\s*\/>$/, '')
+ str = $2.gsub('&lt;','<').gsub('&gt;','>').gsub(/^\s{4}/, '').gsub(/(<br\s\/>)?$/, '')
highlight(str, lang)
end
+ # Regular HTML support
input.gsub /^`{3}\s(\w+)\n(.+?)\n`{3}/m do
lang = $1
str = $2.gsub(/^\s{4}/, '')