Skip to content

Commit

Permalink
style: fix offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
DirtyF committed Nov 4, 2018
1 parent 924ca62 commit aedb403
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions lib/jekyll/excerpt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,16 @@ def render_with_liquid?
#
# Returns excerpt String

LIQUID_TAG_REGEX = %r!{%-?\s*(\w+)\s*.*?-?%}!m.freeze
MKDWN_LINK_REF_REGEX = %r!^ {0,3}\[[^\]]+\]:.+$!.freeze
LIQUID_TAG_REGEX = %r!{%-?\s*(\w+)\s*.*?-?%}!m
MKDWN_LINK_REF_REGEX = %r!^ {0,3}\[[^\]]+\]:.+$!

def extract_excerpt(doc_content)
head, _, tail = doc_content.to_s.partition(doc.excerpt_separator)

# append appropriate closing tag(s) (for each Liquid block), to the `head` if the
# partitioning resulted in leaving the closing tag somewhere in the `tail` partition.
# append appropriate closing tag(s) (for each Liquid block), to the `head`
# if the partitioning resulted in leaving the closing tag somewhere
# in the `tail` partition.

if head.include?("{%")
modified = false
tag_names = head.scan(LIQUID_TAG_REGEX)
Expand Down Expand Up @@ -178,9 +180,12 @@ def print_build_warning
Jekyll.logger.warn "Warning:", "Excerpt modified in #{doc.relative_path}!"
Jekyll.logger.warn "", "Found a Liquid block containing the excerpt separator" \
" #{doc.excerpt_separator.inspect}. "
Jekyll.logger.warn "", "The block has been modified with the appropriate closing tag."
Jekyll.logger.warn "", "Feel free to define a custom excerpt or excerpt_separator in the"
Jekyll.logger.warn "", "document's Front Matter if the generated excerpt is unsatisfactory."
Jekyll.logger.warn "", "The block has been modified with the appropriate" \
" closing tag."
Jekyll.logger.warn "", "Feel free to define a custom excerpt or" \
"excerpt_separator in the"
Jekyll.logger.warn "", "document's Front Matter if the generated excerpt" \
" is unsatisfactory."
end
end
end

0 comments on commit aedb403

Please sign in to comment.