Module: Card::Content::Clean
- Included in:
- Card::Content
- Defined in:
- lib/card/content/clean.rb
Overview
tools for cleaning content, especially for restricting unwanted HTML
Constant Summary collapse
- ALLOWED_TAGS =
.freeze
- ATTR_VALUE_RE =
[/(?<=^')[^']+(?=')/, /(?<=^")[^"]+(?=")/, /\S+/].freeze
Instance Method Summary collapse
Instance Method Details
#clean!(string, tags = ALLOWED_TAGS) ⇒ Object
35 36 37 38 39 |
# File 'lib/card/content/clean.rb', line 35 def clean! string, =ALLOWED_TAGS cleaned = string, cleaned = clean_spaces cleaned if Cardio.config.space_last_in_multispace cleaned end |