mirror of
https://github.com/hugo-fixit/FixIt.git
synced 2026-08-24 15:28:57 +00:00
fix(code): code highlighting not styled for typeit shortcode (#681)
This commit is contained in:
@@ -150,7 +150,7 @@ function add(a, b) {
|
||||
|
||||
## Code block inside other blocks
|
||||
|
||||
> [!NOTE]-
|
||||
> [!NOTE]+
|
||||
>
|
||||
> ```js {mode="classic"}
|
||||
> function add(a, b) {
|
||||
@@ -158,6 +158,14 @@ function add(a, b) {
|
||||
> }
|
||||
> ```
|
||||
|
||||
{{< typeit code=java >}}
|
||||
public class HelloWorld {
|
||||
public static void main(String []args) {
|
||||
System.out.println("Hello World");
|
||||
}
|
||||
}
|
||||
{{< /typeit >}}
|
||||
|
||||
{{< details "Code Block inside Details" >}}
|
||||
|
||||
```js {mode="classic"}
|
||||
|
||||
@@ -69,7 +69,7 @@ pre {
|
||||
@include border-radius($global-border-radius);
|
||||
|
||||
// lineNumbersInTable=true
|
||||
> .chroma {
|
||||
> div.chroma {
|
||||
position: relative;
|
||||
background-color: var(#{$rootPrefix}code-block-background-color);
|
||||
@include border-radius($global-border-radius);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- hugo.Store.Set "version" "v0.4.0" -}}
|
||||
{{- hugo.Store.Set "version" "v0.4.1-20260105065156-43ecb1bd" -}}
|
||||
{{- .Store.Set "this" dict -}}
|
||||
|
||||
{{- partial "init/detection-env.html" . -}}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
{{- /* highlight code content without line number */ -}}
|
||||
{{- $content = highlight $content (.Get "code") "lineNos=false, noClasses=false" -}}
|
||||
{{- /* delete outer label */ -}}
|
||||
{{- $content = replaceRE `.*<code[^<>]*>(?s)(.*)</code>.*` "$1" $content -}}
|
||||
{{- $content = replaceRE `.*<code[^<>]*>(?s)(.*)</code>.*` "<span class=\"chroma\">$1</span>" $content -}}
|
||||
{{- if .Get "code-link" -}}
|
||||
{{- /* parsing code links */ -}}
|
||||
{{- $content = replaceRE `(<span[^<>]*>)([^<>]*)\[([^<>]+)\]\(([^<>]+)\)([^<>]*)(</span>)` "$1$2$6<a href=\"$4\">$3</a>$1$5$6" $content -}}
|
||||
|
||||
Reference in New Issue
Block a user