Commits

Stefan Imhoff committed 19dd9d7

Moved files to _plugins folder

Comments (0)

Files changed (2)

_plugins/ampersand.rb

+# Author: Stefan Imhoff
+#
+# Replaces all occurrence of '&' or '&' surrounded by spaces.
+# It will replace 'Peter & Paul', but not 'Peter&Paul'. It will not
+# replace any '&' or '&' in attributes.
+#
+# Usage: <div class="entry-content">{{ content | ampersand }}</div>
+#
+# Outputs a string like this:
+#
+# Peter&thinsp;<span class="amp">&amp;</span>&thinsp;Paul
+#
+module Jekyll
+  module AmpersandFilter
+    def ampersand(input)
+      input.gsub /\s+(&amp;|&)\s+(?![^">]+"(>|\s+))/, '&thinsp;<span class="amp">&amp;</span>&thinsp;'
+    end
+  end
+end
+
+Liquid::Template.register_filter(Jekyll::AmpersandFilter)

ampersand.rb

-# Author: Stefan Imhoff
-#
-# Replaces all occurrence of '&' or '&amp;' surrounded by spaces.
-# It will replace 'Peter & Paul', but not 'Peter&Paul'. It will not
-# replace any '&' or '&amp;' in attributes.
-#
-# Usage: <div class="entry-content">{{ content | ampersand }}</div>
-#
-# Outputs a string like this:
-#
-# Peter&thinsp;<span class="amp">&amp;</span>&thinsp;Paul
-#
-module Jekyll
-  module AmpersandFilter
-    def ampersand(input)
-      input.gsub /\s+(&amp;|&)\s+(?![^">]+"(>|\s+))/, '&thinsp;<span class="amp">&amp;</span>&thinsp;'
-    end
-  end
-end
-
-Liquid::Template.register_filter(Jekyll::AmpersandFilter)