Class: HTML::Pipeline::AbbrFilter

Inherits:
Filter
  • Object
show all
Defined in:
lib/html/pipeline/abbr_filter.rb

Overview

uses defined abbreviations and add abbr tags around them

Direct Known Subclasses

ShortenFilter

Constant Summary collapse

DEFAULT_IGNORED_ANCESTOR_TAGS =
%w(pre code tt).freeze
DEFINITION_PATTERN =
%r{(?:^|\n)\*\[([^\]]+)\]: *(.+)$}

Instance Method Summary collapse

Instance Method Details

#callObject



9
10
11
12
13
# File 'lib/html/pipeline/abbr_filter.rb', line 9

def call
  abbrs = extract_defs
  replace_abbrs(abbrs) unless abbrs.empty?
  doc
end