forked from Sync/hugo-theme-stack
fix(codeblock): pass through the options of chroma (#715)
* fix(codeblock): pass through the options of chroma Pass through the options of chroma highlighting processing for whom may use some options in codeblock. This commit fix problem with the following scenarios: ```python {linenos=true} print("Hello World") ``` Signed-off-by: cubercsl <2014cais01@gmail.com> * fix(codeblock): margin of no highlight codeblock This commit fix the wrong margin value of the codeblock which can not highlight. The margin is now use the value of ".article-content pre" Signed-off-by: cubercsl <2014cais01@gmail.com> Signed-off-by: cubercsl <2014cais01@gmail.com>
This commit is contained in:
parent
2035beb5a0
commit
21bd04ec89
@ -342,6 +342,10 @@
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
pre {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.table-wrapper {
|
||||
|
@ -13,7 +13,7 @@
|
||||
</header>
|
||||
<code id="codeblock-id-{{ .Ordinal }}" style="display:none;">{{- .Inner -}}</code>
|
||||
{{- if transform.CanHighlight $lang -}}
|
||||
<div class="{{ $class }}">{{- highlight .Inner $lang -}}</div>
|
||||
<div class="{{ $class }}">{{- highlight .Inner $lang .Options -}}</div>
|
||||
{{- else -}}
|
||||
<pre><code class="{{ $class }}">{{- .Inner -}}</code></pre>
|
||||
{{- end -}}
|
||||
|
Loading…
Reference in New Issue
Block a user