diff --git a/lib/haml.rb b/lib/haml.rb index 64b9b208..ee919728 100644 --- a/lib/haml.rb +++ b/lib/haml.rb @@ -546,39 +546,42 @@ $LOAD_PATH << dir unless $LOAD_PATH.include?(dir) # # Haml has the following filters defined: # -# [plain] Does not parse the filtered text. -# This is useful for large blocks of text without HTML tags, -# when you don't want lines starting with . or - -# to be parsed. +# [plain] Does not parse the filtered text. +# This is useful for large blocks of text without HTML tags, +# when you don't want lines starting with . or - +# to be parsed. # -# [ruby] Parses the filtered text with the normal Ruby interpreter. -# All output sent to $stdout, like with +puts+, -# is output into the Haml document. -# Not available if the suppress_eval option is set to true. -# The Ruby code is evaluated in the same context as the Haml template. +# [javascript] Surrounds the filtered text with +END + end + end + module Ruby include Base lazy_require 'stringio' diff --git a/test/haml/results/filters.xhtml b/test/haml/results/filters.xhtml index f022b68e..01009684 100644 --- a/test/haml/results/filters.xhtml +++ b/test/haml/results/filters.xhtml @@ -21,6 +21,15 @@ Wowie-zowie!

pretty much the same as above

+

+ +

This Is Plain diff --git a/test/haml/templates/filters.haml b/test/haml/templates/filters.haml index fa96b875..44afdc74 100644 --- a/test/haml/templates/filters.haml +++ b/test/haml/templates/filters.haml @@ -30,6 +30,12 @@ _pretty much the same as above_ +%p + :javascript + function newline(str) { + return "\n" + str; + } + :plain This Is