1
0
mirror of https://github.com/cotes2020/jekyll-theme-chirpy.git synced 2025-12-18 05:41:31 +00:00

Fix the unsupported code snippets in rouge. (#101)

This commit is contained in:
Cotes Chung
2020-08-15 21:05:48 +08:00
parent 188d8ffc69
commit a8f8bbaa1c
2 changed files with 17 additions and 7 deletions

View File

@@ -20,8 +20,8 @@
https://github.com/penibelst/jekyll-compress-html/issues/71#issuecomment-188144901
-->
{% if _content contains '<pre class="highlight">' %}
{% assign _content = _content | replace: '<pre class="highlight"><code', '<code' %}
{% assign _content = _content | replace: '</code></pre>', '</code>' %}
{% assign _content = _content | replace: '<div class="highlight"><pre class="highlight"><code', '<div class="highlight"><code' %}
{% assign _content = _content | replace: '</code></pre></div>', '</code></div>' %}
{% endif %}
{{ _content }}