See legacy output vs Parsoid output.
Parsoid's HTML is missing the 'error' class attribute.
See legacy output vs Parsoid output.
Parsoid's HTML is missing the 'error' class attribute.
ImageMap throws an ExtensionError which is handled inside Parsoid. The class="error" which legacy implementation adds is thus lost.
Additional note. If you are signed in, and have set your interface language, Parsoid localizes the error using the interface language shown in the infobox, but legacy emits the error in the page language. I assume Parsoid's behavior is the correct behavior here.
The right behavior sounds like a performance question to me as legacy may be doing it to avoid yet another cache split for logged in users.
That is not an issue for Parsoid because we only cache canonical HTML and post-process HTML for rendering (including user preferences like interface language). So, there will not be any cache split. That said, we do plan to add a second level of caching of post-processed HTML, but even there, we may exclude transformations based on user preferences.
If we're creating a unified way of handling errors with ExtensionError, maybe we should try to adopt a unified language that's recognizable across all extensions errors. Maybe that's what the class="error" is already though
Worth verifying if other extensions add class="error" to their error messages. And, if yes, this is easily resolved by adding class="error" inside Parsoid's extension handler.
Looks like it is fine to add the .error class in Parsoid's output since they are embedded inside a parser-output container. T281228: Provide styling for parser-outputted .error class in content-parser-output (split out from T280766) provides default styling for this class.
Change #1182941 had a related patch set uploaded (by Subramanya Sastry; author: Subramanya Sastry):
[mediawiki/services/parsoid@master] WIP: ExtensionError i18n fragments get class='error'
Change #1182973 had a related patch set uploaded (by Subramanya Sastry; author: Subramanya Sastry):
[mediawiki/extensions/ImageMap@master] Updated html/parsoid section + temporarily disable updated tests for Parsoid
Change #1182973 merged by jenkins-bot:
[mediawiki/extensions/ImageMap@master] Updated html/parsoid section + temporarily disable updated tests for Parsoid
Change #1182941 merged by jenkins-bot:
[mediawiki/services/parsoid@master] ExtensionError i18n fragments get class='error'
Change #1185118 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):
[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.22.0-a20
Change #1185118 merged by jenkins-bot:
[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.22.0-a20
Post deploy and purge, the font is now the same but there's still a bit of a whitespace difference because the errors class is on a paragraph in the legacy output and a span in the Parsoid, but that's probably acceptable,
https://srn.wikipedia.org/w/index.php?title=Pasuni_fu_Para&useparsoid=0
https://srn.wikipedia.org/w/index.php?title=Pasuni_fu_Para&useparsoid=1
Change #1206483 had a related patch set uploaded (by Subramanya Sastry; author: Subramanya Sastry):
[mediawiki/services/parsoid@master] ParsoidExtensionAPI: Error i18n fragments get class='error'
Change #1206483 merged by jenkins-bot:
[mediawiki/services/parsoid@master] ParsoidExtensionAPI: Error i18n fragments get class='error'
Change #1210725 had a related patch set uploaded (by Arlolra; author: Arlolra):
[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.23.0-a6
Change #1210725 merged by jenkins-bot:
[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.23.0-a6