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 =
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, tags=ALLOWED_TAGS
  cleaned = clean_tags string, tags
  cleaned = clean_spaces cleaned if Cardio.config.space_last_in_multispace
  cleaned
end