Skip to content

Commit 449957f

Browse files
committed
fix: Fix Element.SetHtml with empty text passed.
1 parent 25d8ed4 commit 449957f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sciter.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,6 +1144,10 @@ func (e *Element) SelectParent(css_selector string, depth int) (*Element, error)
11441144

11451145
// SCDOM_RESULT SciterSetElementHtml(HELEMENT he, const BYTE* html, UINT htmlLength, UINT where)
11461146
func (e *Element) SetHtml(html string, where SET_ELEMENT_HTML) error {
1147+
if len(html) == 0 {
1148+
return e.Clear()
1149+
}
1150+
11471151
// args
11481152
chtml := (*C.BYTE)(StringToBytePtr(html))
11491153
clen := C.UINT(len(html))

0 commit comments

Comments
 (0)