HTML/JavaScript rendered inconsistently

I’m writing a book about JavaScript and its use in HTML. When I compile to epub, my HTML snippets, which I want to appear as text, are not rendered consistently. Specifically, “<” should be encoded as “<” and “>” should be encoded as “>”, so when I type “”, the result in the epub file should be “<script>”. Sometimes it is, and sometimes it is just “”.

Is this a known bug? Is there a workaround? There is a Copy as HTML command that I don’t understand–is it relevant?

I could correct the epub manually with Sigil if it only happens in a few cases, but this is a (small) book about JavaScript, so I’m afraid the effort might be overwhelming. Help?

–Dave

P.S. Attachments

Note: In the text file I replaced all occurrences of “<” with “+”, because otherwise it was considered a possible attack vector and would not let me attach it.


button bug.txt (1.05 KB)

Trying yet again to attach this.
button bug.txt (1.05 KB)