Sha256: e64a1092a68db5352ec27c6074adb28dcdb2cd64b185708f02c447b0a3121676
Contents?: true
Size: 748 Bytes
Versions: 47
Compression:
Stored size: 748 Bytes
Contents
# frozen_string_literal: true module Haml class Filters class Javascript < TextBase def compile(node) case @format when :xhtml compile_xhtml(node) else compile_html(node) end end private def compile_html(node) temple = [:multi] temple << [:static, "<script>\n"] compile_text!(temple, node, ' ') temple << [:static, "\n</script>"] temple end def compile_xhtml(node) temple = [:multi] temple << [:static, "<script type='text/javascript'>\n //<![CDATA[\n"] compile_text!(temple, node, ' ') temple << [:static, "\n //]]>\n</script>"] temple end end end end
Version data entries
47 entries across 47 versions & 1 rubygems