Module: Card::Content::Clean

Included in:
Card::Content
Defined in:
card/lib/card/content/clean.rb

Overview

tools for cleaning content, especially for restricing 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 'card/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