Sha256: 251235ebe372fd36589a8e49dcd56f73c3a6d06dee65fdb1a261e7a37df31782

Contents?: true

Size: 632 Bytes

Versions: 3

Compression:

Stored size: 632 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 is can't be edited."
  end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
card-1.99.2 mod/basic_formats/set/self/head.rb
card-1.99.1 mod/basic_formats/set/self/head.rb
card-1.99.0 mod/basic_formats/set/self/head.rb