Sha256: f0a045092ce568c2944483bfdc10180b595df4c3205f72728d81d458b8f56029

Contents?: true

Size: 678 Bytes

Versions: 13

Compression:

Stored size: 678 Bytes

Contents

# @Opulent
module Opulent
  # @Compiler
  class Compiler
    # Generate the code for a standard text node
    #
    # @param node [Array] Node code generation data
    # @param indent [Fixnum] Size of the indentation to be added
    # @param context [Context] Processing environment data
    #
    def plain(node, indent, context)
      value = node[@options][:value]

      # Evaluate text node if it's marked as such and print nodes in the
      # current context
      if node[@value] == :text
        buffer_split_by_interpolation value, node[@options][:escaped]
      else
        node[@options][:escaped] ? buffer_escape(value) : buffer(value)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
opulent-1.5.5 lib/opulent/compiler/text.rb
opulent-1.5.4 lib/opulent/compiler/text.rb
opulent-1.5.3 lib/opulent/compiler/text.rb
opulent-1.5.2 lib/opulent/compiler/text.rb
opulent-1.5.1 lib/opulent/compiler/text.rb
opulent-1.5.0 lib/opulent/compiler/text.rb
opulent-1.4.8 lib/opulent/compiler/text.rb
opulent-1.4.7 lib/opulent/compiler/text.rb
opulent-1.4.6 lib/opulent/compiler/text.rb
opulent-1.4.5 lib/opulent/compiler/text.rb
opulent-1.4.3 lib/opulent/compiler/text.rb
opulent-1.4.2 lib/opulent/compiler/text.rb
opulent-1.4.1 lib/opulent/compiler/text.rb