Just wanted to let you know that the e-mail obfuscation is breaking the JSON that get's rendered for headless mode.:
SyntaxError: JSON.parse: expected ',' or '}' after property value in object at line
You are adding some unescaped Javascript there into the JSON, so currently it's impossible to write an e-mail into a textblock and use headless mode.
If I can make a suggestion, you are already writing into the comment "That way it is possible to separate email addresses within <a></a> tags from stand-alone ones.", why not leave the ones in <a></a> tags alone and only obfuscate the single e-mails. Alternatively add a simple setting to turn this off, or escape the JS before putting it into the JSON string.