Last modified: 2013-07-16 18:04:40 UTC
This is related to bug 41545. See also gerrit change I194167f3c0621394ab4fb40e242711ccb86615ae The parser, when given "<em>X<em>Y</em>Z</em>" emits "<p><em>X<em>Y</em>Z</em></p>". The same bogus escaping also occurs for <b>.
Note that the HTML spec (http://www.w3.org/TR/html5/text-level-semantics.html) gives an explicit meaning for nested <em>, <strong>, <q>, <ruby>, and <bdo>. There are other nestable tags (<b>, <i>, <s>, <u>, <cite>, <dfn>, <abbr>, <time>, <code>, <mark>, <rt>, <rp>, <bdi>) which I've chosen not to fix since the spec allows but does not give semantics for them.
Change 72981 had a related patch set uploaded by Cscott: Fix incorrect escaping of nested <em>, <strong>, <q>, <ruby>, and <bdo> https://gerrit.wikimedia.org/r/72981
Change 72981 merged by jenkins-bot: Fix incorrect escaping of nested <em>, <strong>, <q>, <ruby>, and <bdo> https://gerrit.wikimedia.org/r/72981