web/_includes/refactor-content.html
Cotes Chung 188d8ffc69 Resume the min-width of the tables.
It was lost by mistake while fixing #85
2020-08-15 01:01:27 +08:00

27 lines
921 B
HTML

<!--
Refactor the HTML structure.
-->
{% assign _content = include.content %}
<!--
Suroundding the markdown table with '<div class="table-wrapper">. and '</div>'
-->
{% if _content contains '<table>' %}
{% assign _content = _content | replace: '<table>', '<div class="table-wrapper"><table>' %}
{% assign _content = _content | replace: '</table>', '</table></div>' %}
{% assign _content = _content | replace: '</table></div></code>', '</table></code>' %}
{% endif %}
<!--
Fixed kramdown code highlight rendering:
https://github.com/penibelst/jekyll-compress-html/issues/101
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>' %}
{% endif %}
{{ _content }}