Skip to content

Commit

Permalink
print warning only if excerpt has been modified
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmaroli committed Sep 18, 2018
1 parent e1d6db0 commit 1c58230
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/jekyll/excerpt.rb
Expand Up @@ -142,14 +142,15 @@ def extract_excerpt(doc_content)
if head.include?("{%")
tag_names = head.scan(LIQUID_TAG_REGEX)
tag_names.flatten!
print_build_warning unless tag_names.empty?

modified = false
tag_names.reverse_each do |tag_name|
next unless liquid_block?(tag_name)
next if head =~ endtag_regex_stash(tag_name)

modified = true
head << "\n{% end#{tag_name} %}"
end
print_build_warning if modified
end

return head if tail.empty?
Expand Down

0 comments on commit 1c58230

Please sign in to comment.