dont apply formatting to empty content

This commit is contained in:
Face
2025-09-11 17:59:03 +03:00
parent acc51d6aa2
commit 08b4262741

View File

@@ -504,6 +504,10 @@ static func apply_element_bbcode_formatting(element: HTMLElement, styles: Dictio
# Apply general styling first (color, font-weight) for all elements
var formatted_content = content
# Don't apply any formatting to empty content
if formatted_content.strip_edges().length() == 0:
return formatted_content
# Apply font weight (bold/semibold/etc)
if styles.has("font-bold") and styles["font-bold"]:
formatted_content = "[b]" + formatted_content + "[/b]"