Sha256: 976111ec87a33765330ff20397059ff0ee351b46e3eb1e20b2d29ccc542372cd

Contents?: true

Size: 629 Bytes

Versions: 5

Compression:

Stored size: 629 Bytes

Contents

format :html do
  # when *head is rendered in the main body of a page, we escape the HTML
  # otherwise (most typically in the head tag, of course), we render the
  # HTML unescaped
  view :core, cache: :never do
    escape_in_main do
      nest root.card, view: :head
      # note that the head tag for each card is different
      # (different title, different style rules, etc)
      # so we don't cache the core of *head, but we _do_ cache some
      # views within each head (see all/head.rb)
    end
  end

  view :input do
    "Content can't be edited."
  end

  def escape_in_main
    main? ? (h yield) : yield
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
card-1.100.0 mod/basic_formats/set/self/head.rb
card-1.99.6 mod/basic_formats/set/self/head.rb
card-1.99.5 mod/basic_formats/set/self/head.rb
card-1.99.4 mod/basic_formats/set/self/head.rb
card-1.99.3 mod/basic_formats/set/self/head.rb