diff --git a/exampleSite/content/shortcodes/tabs.en.md b/exampleSite/content/shortcodes/tabs.en.md index 8c69170a6b..8ae852b32c 100644 --- a/exampleSite/content/shortcodes/tabs.en.md +++ b/exampleSite/content/shortcodes/tabs.en.md @@ -113,9 +113,9 @@ While pressing a tab of Group A switches all tab views of Group A in sync (if th ````go {{* tabs groupid="a" */>}} {{%/* tab title="json" */%}} -```json +{{* highlight json "linenos=true" */>}} { "Hello": "World" } -``` +{{* /highlight */>}} {{%/* /tab */%}} {{%/* tab title="_**XML**_ stuff" */%}} ```xml @@ -132,9 +132,9 @@ While pressing a tab of Group A switches all tab views of Group A in sync (if th ````go {{* tabs groupid="a" */>}} {{%/* tab title="json" */%}} -```json +{{* highlight json "linenos=true" */>}} { "Hello": "World" } -``` +{{* /highlight */>}} {{%/* /tab */%}} {{%/* tab title="XML stuff" */%}} ```xml @@ -148,9 +148,9 @@ While pressing a tab of Group A switches all tab views of Group A in sync (if th ````go {{* tabs groupid="b" */>}} {{%/* tab title="json" */%}} -```json +{{* highlight json "linenos=true" */>}} { "Hello": "World" } -``` +{{* /highlight */>}} {{%/* /tab */%}} {{%/* tab title="XML stuff" */%}} ```xml @@ -167,9 +167,9 @@ While pressing a tab of Group A switches all tab views of Group A in sync (if th {{< tabs groupid="tab-example-a" >}} {{% tab title="json" %}} -```json +{{< highlight json "linenos=true" >}} { "Hello": "World" } -``` +{{< /highlight >}} {{% /tab %}} {{% tab title="_**XML**_ stuff" %}} ```xml @@ -187,9 +187,9 @@ While pressing a tab of Group A switches all tab views of Group A in sync (if th {{< tabs groupid="tab-example-a" >}} {{% tab title="json" %}} -```json +{{< highlight json "linenos=true" >}} { "Hello": "World" } -``` +{{< /highlight >}} {{% /tab %}} {{% tab title="XML stuff" %}} ```xml @@ -202,9 +202,9 @@ While pressing a tab of Group A switches all tab views of Group A in sync (if th {{< tabs groupid="tab-example-b" >}} {{% tab title="json" %}} -```json +{{< highlight json "linenos=true" >}} { "Hello": "World" } -``` +{{< /highlight >}} {{% /tab %}} {{% tab title="XML stuff" %}} ```xml diff --git a/exampleSite/content/tests/code/_index.en.md b/exampleSite/content/tests/code/_index.en.md index 6f3f2e8106..2788ccda21 100644 --- a/exampleSite/content/tests/code/_index.en.md +++ b/exampleSite/content/tests/code/_index.en.md @@ -49,3 +49,139 @@ Code fences without any selected language
Some preformatted stuff in HTML elements+ +## Nested Shortcode + +### 1 Shortcode + +#### %% + +{{% highlight json "linenos=inline" %}} +{ + "Hello": "World" "Hello": "World" "Hello": "World" +} +{{% /highlight %}} + +#### <> + +{{< highlight json "linenos=table" >}} +{ + "Hello": "World" "Hello": "World" "Hello": "World" +} +{{< /highlight >}} + +### 2 Shortcodes + +#### %% %% + +{{% tab title="json" %}} +{{% highlight html "linenos=true" %}} +
my code
+{{% /highlight %}} +{{% /tab %}} + +#### %% <> + +{{% tab title="json" %}} +{{< highlight html "linenos=true" >}} +my code
+{{< /highlight >}} +{{% /tab %}} + +#### <> %% + +{{< tab title="json" >}} +{{% highlight html "linenos=true" %}} +my code
+{{% /highlight %}} +{{< /tab >}} + +#### <> <> + +{{< tab title="json" >}} +{{< highlight html "linenos=true" >}} +my code
+{{< /highlight >}} +{{< /tab >}} + +### 3 Shortcodes + +#### %% %% %% + +{{% tabs %}} +{{% tab title="json" %}} +{{% highlight html "linenos=true" %}} +my code
+{{% /highlight %}} +{{% /tab %}} +{{% /tabs %}} + +#### %% %% <> + +{{% tabs %}} +{{% tab title="json" %}} +{{< highlight html "linenos=true" >}} +my code
+{{< /highlight >}} +{{% /tab %}} +{{% /tabs %}} + +#### %% <> %% + +{{% tabs %}} +{{< tab title="json" >}} +{{% highlight html "linenos=true" %}} +my code
+{{% /highlight %}} +{{< /tab >}} +{{% /tabs %}} + +#### %% <> <> + +{{% tabs %}} +{{< tab title="json" >}} +{{< highlight html "linenos=true" >}} +my code
+{{< /highlight >}} +{{< /tab >}} +{{% /tabs %}} + +#### <> %% %% + +{{< tabs >}} +{{% tab title="json" %}} +{{% highlight html "linenos=true" %}} +my code
+{{% /highlight %}} +{{% /tab %}} +{{< /tabs >}} + +#### <> %% <> + +{{< tabs >}} +{{% tab title="json" %}} +{{< highlight html "linenos=true" >}} +my code
+{{< /highlight >}} +{{% /tab %}} +{{< /tabs >}} + +#### <> <> %% + +{{< tabs >}} +{{< tab title="json" >}} +{{% highlight html "linenos=true" %}} +my code
+{{% /highlight %}} +{{< /tab >}} +{{< /tabs >}} + +#### <> <> <> + +{{< tabs >}} +{{< tab title="json" >}} +{{< highlight html "linenos=true" >}} +my code
+{{< /highlight >}} +{{< /tab >}} +{{< /tabs >}} diff --git a/layouts/partials/shortcodes/expand.html b/layouts/partials/shortcodes/expand.html index 3b30bd2fe0..d5f5f379dc 100644 --- a/layouts/partials/shortcodes/expand.html +++ b/layouts/partials/shortcodes/expand.html @@ -16,7 +16,7 @@ {{ $title | .RenderString }} {{- end }} \ No newline at end of file diff --git a/layouts/partials/shortcodes/notice.html b/layouts/partials/shortcodes/notice.html index 5bacde9cc7..8f82b1f36a 100644 --- a/layouts/partials/shortcodes/notice.html +++ b/layouts/partials/shortcodes/notice.html @@ -19,7 +19,7 @@{{ end }} +{{ if ne "<" (substr (strings.TrimLeft " \n\r\t" $content) 0 1) }}
{{ end }} {{ $content | safeHTML }}
{{ end }} +{{ if ne "<" (substr (strings.TrimLeft " \n\r\t" .content) 0 1) }}
{{ end }} {{ .content | safeHTML }}