Module: Jekyll::BibleReferences

Defined in:
lib/jekyll/bible_references.rb,
lib/jekyll/bible_references/version.rb,
lib/jekyll/bible_references/linkify_filter.rb,
lib/jekyll/bible_references/default_linkifier.rb,
lib/jekyll/bible_references/scripture_pattern.rb

Defined Under Namespace

Classes: DefaultLinkifier, LinkifyFilter, ScripturePattern

Constant Summary collapse

BODY_START_TAG =
"<body"
OPENING_BODY_TAG_REGEX =
/<body(.*?)>\s*/m.freeze
VERSION =
"0.1.2"

Class Method Summary collapse

Class Method Details

.linkify(page) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/jekyll/bible_references.rb', line 16

def linkify(page)
  if page.output.include? BODY_START_TAG
    head, opener, tail  = page.output.partition(OPENING_BODY_TAG_REGEX)
    body_content, *rest = tail.partition("</body>")

    processed_markup = process_body(body_content, page)
    page.output = [head, opener, processed_markup, rest.join].join
    return
  end

  page.output = process_body(page.output, page)
end