Themes: don't inline text fields if they don't have text around them

This commit is contained in:
Pieter Vander Vennet 2024-09-02 15:01:03 +02:00
parent 0c1b5d1b6c
commit 821ddcfaca

View file

@ -541,6 +541,13 @@ class DetectInline extends DesugaringStep<QuestionableTagRenderingConfigJson> {
context.err("'freeform' is a string, but should be an object")
return json
}
if(!Object.values(json.render).some(render => render !== "{"+json.freeform.key+"}")){
// We only render the current value, without anything more. Not worth inlining
return json
}
json.freeform.inline ??= true
return json
}