Revert "Refactor highlight tag to behave like the raw tag" (#7592)

* Revert "Refactor `highlight` tag to behave like the `raw` tag (#6821)"

This reverts commit 36404b9a43.

* use Liquid `raw` in upgrading document
* let the minor improvements stay
* Revert entry in History.markdown
This commit is contained in:
Ashwin Maroli
2019-04-19 12:49:03 +05:30
committed by GitHub
parent 36d3aed1f2
commit f4ee82650e
6 changed files with 4 additions and 80 deletions

View File

@@ -2,7 +2,7 @@
module Jekyll
module Tags
class HighlightBlock < Liquid::Raw
class HighlightBlock < Liquid::Block
include Liquid::StandardFilters
# The regular expression syntax checker. Start with the language specifier.
@@ -33,7 +33,7 @@ module Jekyll
def render(context)
prefix = context["highlighter_prefix"] || ""
suffix = context["highlighter_suffix"] || ""
code = @body.gsub(LEADING_OR_TRAILING_LINE_TERMINATORS, "")
code = super.to_s.gsub(LEADING_OR_TRAILING_LINE_TERMINATORS, "")
output =
case context.registers[:site].highlighter
@@ -103,8 +103,6 @@ module Jekyll
"<figure class=\"highlight\"><pre><code #{code_attributes}>"\
"#{code.chomp}</code></pre></figure>"
end
def ensure_valid_markup(tag_name, markup, parse_context); end
end
end
end