Skip to content

Commit

Permalink
Enable striptags on Windows (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota committed Jul 5, 2023
1 parent 1a13bcf commit 15a4a13
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/lib/filter/string.cr
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% unless flag?(:win32) %}require "xml"{% end %}
require "xml"

module Crinja::Filter
Crinja.filter(:upper) { target.to_s.upcase }
Expand All @@ -24,12 +24,10 @@ module Crinja::Filter
end
end

{% unless flag?(:win32) %}
Crinja.filter :striptags do
xml = XML.parse_html target.to_s
xml.inner_text.gsub(/\s+/, " ").strip
end
{% end %}
Crinja.filter :striptags do
xml = XML.parse_html target.to_s
xml.inner_text.gsub(/\s+/, " ").strip
end

Crinja.filter(:format) { sprintf target.to_s, arguments.varargs }

Expand Down

0 comments on commit 15a4a13

Please sign in to comment.