If a message contains a magic word, e.g. {{PLURAL}}, that returns HTML, the HTML is not parsed by mw.message.parse().
mw.messages.set( 'foo', '<strong>$1</strong> {{PLURAL:$1|article|articles}}' ); mw.messages.set( 'bar', '{{PLURAL:$1|<strong>$1</strong> article|<strong>$1</strong> articles}}' ); mw.message( 'foo', 42 ).parse(); // Returns '<strong>42</strong> articles', as expected mw.message( 'bar', 42 ).parse(); // Returns '<strong>42</strong> articles', unexpected
These two should behave the same, but they don't. In PHP, they do behave the same:
echo ( new RawMessage( '<strong>$1</strong> {{PLURAL:$1|article|articles}}' ) )->numParams( 42 )->parse(); // <strong>42</strong> articles echo ( new RawMessage( '{{PLURAL:$1|<strong>$1</strong> article|<strong>$1</strong> articles}}' ) )->numParams( 42 )->parse(); // <strong>42</strong> articles