Skip to content

Commit 9b1abc7

Browse files
committed
fix: empty default empty string parameter in global components
1 parent 1c1d9f6 commit 9b1abc7

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

renderer/html/param_ref.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,5 +168,9 @@ func (p *paramRefInGlobalCompDef) Render() string {
168168
return ast.IsRuleNameOneOf(node, []string{"comp-string-param", "comp-call-param", "comp-bool-param"})
169169
}).Children(), "comp-param-defa-value")
170170

171+
if compParamDefaValue == nil {
172+
return ""
173+
}
174+
171175
return html.EscapeString(strings.TrimSpace(string(compParamDefaValue.Raw())))
172176
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
str = ""
2-
*It must not panic* {{ str }}
2+
**It must not panic** {{ str }}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<p><strong>It must not panic</strong></p>
1+
<p><strong>It must not panic</strong> </p>

0 commit comments

Comments
 (0)