shortcodes: don't break build and render for invalid parameters #480

This commit is contained in:
Sören Weber 2023-02-19 23:09:51 +01:00
parent 472176a88c
commit 0e0b3bb2fb
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
5 changed files with 66 additions and 3 deletions

View file

@ -0,0 +1,43 @@
+++
description = "Test default settings for snippets of the VSCode Front Matter extension"
title = "VSCode Front Matter"
+++
## Empty Properties
{{< attachments title="" pattern="" sort="" style="" color="" icon="" />}}
{{< badge title="" style="" color="" icon="" >}}{{< /badge >}}
{{< button href="" target="" type="" style="" color="" icon="" iconposition="" >}}{{< /button >}}
{{< children description="" depth="" sort="" showhidden="" containerstyle="" style="" >}}
{{% expand title="" open="" %}}{{% /expand %}}
a{{< icon >}}a
{{< include file="" hidefirstheading="" >}}
````math align=""
````
````mermaid align="" zoom=""
````
{{% notice title="" style="" color="" icon="" %}}{{% /notice %}}
{{< siteparam >}}
{{< swagger src="" >}}
{{< tabs groupid="" >}}
{{% tab name="" %}}
{{% /tab %}}
{{% tab name="" %}}
{{% /tab %}}
{{< /tabs >}}

View file

@ -0,0 +1,5 @@
+++
description = "Test default settings for snippets of the VSCode Front Matter extension"
title = "VSCode Front Matter"
+++
{{< piratify >}}

View file

@ -4,10 +4,12 @@
{{- if eq (printf "%T" $hideFirstHeading) "string" }} {{- if eq (printf "%T" $hideFirstHeading) "string" }}
{{- $hideFirstHeading = (eq $hideFirstHeading "true") }} {{- $hideFirstHeading = (eq $hideFirstHeading "true") }}
{{- end }} {{- end }}
{{- if $hideFirstHeading }}<div class="include hide-first-heading">{{ end }} {{- if and (gt (len (trim $file " ")) 0) (fileExists $file) }}
{{- with $context }} {{- if $hideFirstHeading }}<div class="include hide-first-heading">{{ end }}
{{- with $context }}
{{ $file | readFile | safeHTML }} {{ $file | readFile | safeHTML }}
{{- if $hideFirstHeading }}</div>{{ end }} {{- end }}
{{- if $hideFirstHeading }}</div>{{ end }}
{{- end }} {{- end }}

View file

@ -24,6 +24,10 @@ html[dir="rtl"] #body .tab-nav-button{
float: right; float: right;
} }
#body .tab-nav-button:after {
content: "\200b"
}
#body .tab-nav-button:first-child{ #body .tab-nav-button:first-child{
margin-inline-start: 9px; margin-inline-start: 9px;
} }

View file

@ -1318,6 +1318,11 @@ html[dir="rtl"] .expand > .expand-label > i.fa-chevron-right {
white-space: nowrap; white-space: nowrap;
} }
.btn > *:after {
/* avoid breakage if no content is given */
content: "\200b"
}
#body #body-inner .btn > *.highlight:after { #body #body-inner .btn > *.highlight:after {
background-color: transparent; background-color: transparent;
} }
@ -1700,6 +1705,10 @@ html[dir] #sidebar .collapsible-menu input.toggle:checked:before {
border-end-start-radius: 0; border-end-start-radius: 0;
} }
.badge-content:after {
/* avoid breakage if no content is given */
content: "\200b";
}
/* task list and its checkboxes */ /* task list and its checkboxes */
article ul li:has(input[type="checkbox"]) { article ul li:has(input[type="checkbox"]) {
list-style: none; list-style: none;