Hello,
I think it's a pity that FireGPG allows to encrypt data only but not HTML tags. It's not very convenient to encrypt all data fields one by one let alone the display problems.
I think often it would make more sense to encrypt parts of the document that include tags. an example:
<div class="firegpgcontainer">
<p>This is my <strong>formatted</strong> text with my <a href="youneverknow.tld">secret link</a>.</p>
</div>
could be transformed into
<div class="firegpgcontainer">
-----BEGIN PGP MESSAGE-----
Version: GnuPG v2.0.9 (GNU/Linux)
hQIOA0NeQ3HmI++IEAf/RwUzty28vpcQmkfpKgzRkd/pxkwTiW0DyFDoXd0Ju420
IXpRzzo6WW7GiBFLc0+eCcIr8bZ/hLcTCtpga7/JiBP8jEkC8VDC78+rAU44lca5
PICYIZ6M2jZoblDwt8pDPxvDsmo4dURGtWAYRnoDS69zBo4GPWZ4QfT/0uEA+oSG
QoemictFa1sYbRwlP5IrTdsCLfy9NfSZg+vT0/I1Pc/AHGSWGgQXDl5c+504yweZ
8yCybE6NqakXLsX0R8ATsiS23bW66VPpsGrI+NRbwjIKg2+/rPiCU5gcbZchPTBB
EywNx/lh4CvDxURBBKSOJLYhefJ8ZCwfljP8s+jNPwf+Is56aQPW1cwuaPxM+2Ys
buPr3KL3yGOI/QbT+UZYcbX5wjLrlAZJ9lH3InLBo9jBZAFF9arO4SoYm3fLaAFs
53oie3eqI6rozXwC+X952YH37BGGXfphnGE5On7BkI7ODCSXKLQRoN8LU4wjeaLZ
fOS3+xLr6rLKkrfTjp07+pSJ7FbNw7pynq6oAOUrqRuTeFGNUX6M8XHUxudyhs5O
HXsU3xHnVKgwPSfPozp9aCphKlfpbtWphL5lrxp++hQiT5slN61z9WtsnUQBSUQ3
4Iwr2dR4HJwwzOIwszBDRmAp4uZD3h2wkr5lBD9rTKu3Fa1zwCG3b7RVpMeYRfTe
mNKWAWDc9kVmRn4tJCV8KbtWyp9IhqQX/sLriNke6gmQLa7fAEN+gsC/i1Ic16eJ
r0CrOxpZp54Tk4XlY1LIje6rrfdJjqNsC5i82W0dxwxLu4eTpIYsPI6TGjMYDew7
qlWL4QHCF7H807eiv5bnNpaITe3smOZarlQJxKke8omorIWK+ThqdbY9p7cZ7Jp6
FtSEH6se/KSe
=A7QW
-----END PGP MESSAGE-----
</div>
That would be correct from an HTML parser's point of view (plain text without illegal characters within <div>). After decryption the result could be added to the Document by adding DOM nodes and their content. This could be restricted to valid code. So it might be necessary to install one of the existing offline validation add-ons. Thus it might make sense to restrict the encrypted DUM subtree to XHTML. Perhaps it is possible to create a new "document" without opening a window in Firefox. Then you could create a temporary document:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<div class="firegpgcontainer">
<!-- insert decrypted data here -->
</div>
</body>
</html>
have that one checked by a validator add-on and in case of success simply read and copy the DOM nodes and contents from the temporary document into the real one. But that's just an implementation idea by someone who doesn't know anything about this kind of programming. :-)