Bug: Crash when RegEx for AnyCharacter and HTML <title> is empty

Leif H Silli <[email protected]> Sun, 24 Nov 2024 17:29:54 +0100
Newsgroups gmane.editors.xxe.general
Organization Lenk.no/Silli
Message-ID <[email protected]>
(I have gotten the same result twice, for the same HTML document. But I 
did not look deeply to understand the reason/cause of this bug.)

1) What I did:

I was thinking to myself about proposing that XXE should get a Word & 
Character count tool. But then I figured I should just use XXE’s RegEx, 
for the time being.

However, in my HTML document, I did not want to count the content of the 
<title> element. But how to avoid that?

I ended up deleting the content of <title> - which thus became empty.

And then I placed the cursor inside <title> (since that was the topmost 
element in my simple document).

2) Expected outcome:

I would search for AnyCharacter (using the dott in a RegEx search) in 
the document, replacing the each finding with $0. I would then get, as 
«side effect» the numer of replacements displayed at the bottom of the 
Window in XXE.

3) Actual result:

The above expectation did work, as long as <title> was non-empty. But 
when <title> was empty (and the cursor as well – and logically - was 
placed inside <title>), XXE would start to crash. (The crashing took for 
ever, so it would perhaps be more accurate to describe it as a freeze.)

4) Workaround:

Make sure that <title> is not empty.

Btw, I wonder if the same thing would happen for any empty element that 
is supposed to be able to contain textual content. However, I did not 
run any tests to check/verify that assumption.

Leif Halvard Silli

--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support