Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredcwhite committed Nov 4, 2023
1 parent 950ee52 commit 666e057
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 2 additions & 0 deletions lib/lifeform/form.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

require "hash_with_dot_access"
require "sequel/model/default_inflections"
require "sequel/model/inflections"

module Lifeform
FieldDefinition = Struct.new(:type, :library, :parameters)
Expand Down
5 changes: 1 addition & 4 deletions lib/lifeform/helpers.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# frozen_string_literal: true

require "sequel/model/default_inflections"
require "sequel/model/inflections"

module Lifeform
module Helpers
# Below is pretty much verbatim copied over from Bridgetown
Expand Down Expand Up @@ -79,7 +76,7 @@ def encode(...)

def text(callback)
(callback.is_a?(Proc) ? html(callback) : callback).to_s.then do |str|
next str if str.respond_to?(:html_safe) && str.html_safe?
next str if str.html_safe?

str.encode(xml: :attr).gsub(%r{\A"|"\Z}, "")
end
Expand Down

0 comments on commit 666e057

Please sign in to comment.