There is a test case in EntitiesVerifier of SiteTools. The following xdoc (cut):
<!DOCTYPE document [ <!ENTITY Alpha "Α"> <!-- greek capital letter alpha, U+0391 --> <!ENTITY tritPos "𝟭"> <!-- MATHEMATICAL SANS-SERIF BOLD DIGIT ONE --> ]> <h3>Local Entities: 'Α' '&tritPos;'</h3> <p>'Α' '&tritPos;'</p>
produces:
<h3>Local Entities: 'Α' '&#x1d7ed;'</h3> <p>'Α' '𝟭'</p>
ie the replacement text for &tritPos; gets un-escaped in the title while it is correct in the paragraph.
done in r771709
done in r771709