getElementHTML can return both undefined and null, in which case blockEntities should replace that "html" with originalText. However, the existing check for this case was also replacing '', since it is falsy, meaing '' || originalText resolved to originalText.
Before this change, it was impossible to fully strip entity text when converting to HTML without including dummy tags with dummy children (e.g. <span>{''}</span>).
getElementHTML
can return bothundefined
andnull
, in which caseblockEntities
should replace that "html" withoriginalText
. However, the existing check for this case was also replacing''
, since it is falsy, meaing'' || originalText
resolved tooriginalText
.Before this change, it was impossible to fully strip entity text when converting to HTML without including dummy tags with dummy children (e.g.
<span>{''}</span>
).