EZP-22509: HTML pasted into literal ends up outside literal tag when the source is not plaintext

JIRA: https://jira.ez.no/browse/EZP-22509 (follow up of https://jira.ez.no/browse/EZP-22313 fixed in #905)

# Description

# Tests