lib/nanoc/helpers/html_escape.rb in nanoc-3.6.7 vs lib/nanoc/helpers/html_escape.rb in nanoc-3.6.8

- old
+ new

@@ -26,11 +26,11 @@ # # The buffer will now contain “&lt;h1&gt;Hello &lt;em&gt;world&lt;/em&gt;!&lt;/h1&gt;” # # @param [String] string The string to escape # # @return [String] The escaped string - def html_escape(string=nil, &block) + def html_escape(string = nil, &block) if block_given? # Capture and escape block data = capture(&block) escaped_data = html_escape(data) @@ -41,15 +41,15 @@ string.gsub('&', '&amp;'). gsub('<', '&lt;'). gsub('>', '&gt;'). gsub('"', '&quot;') else - raise RuntimeError, "The #html_escape or #h function needs either a " \ + raise "The #html_escape or #h function needs either a " \ "string or a block to HTML-escape, but neither a string nor a block was given" end end - alias h html_escape + alias_method :h, :html_escape end end