Class: Yuzu::PostProcessors::ContentsWithoutFirstParagraphPostProcessor
Instance Attribute Summary
#name
Instance Method Summary
collapse
postprocessors, registry, #value
Constructor Details
5
6
7
8
|
# File 'lib/yuzu/postprocessors/contents_without_first_paragraph.rb', line 5
def initialize
@name = :contents_without_first_paragraph
@directive = "CONTENTSWITHOUTFIRSTPARAGRAPH"
end
|
Instance Method Details
#match(contents) ⇒ Object
14
15
16
|
# File 'lib/yuzu/postprocessors/contents_without_first_paragraph.rb', line 14
def match(contents)
contents.sub(regex, "")
end
|
10
11
12
|
# File 'lib/yuzu/postprocessors/contents_without_first_paragraph.rb', line 10
def regex
/<p\b[^>]*?>(.*?)<\/p>/n
end
|