Currently, the Extension:Popup preview is only working in SVG mode.
Working preview in SVG mode.
Does not work with MathML.
Tested in Firefox(131.0) / Google Chrome(131.0.6778.86)
FrederikHennecke1 | |
Wed, Nov 27, 9:59 PM |
F57754249: mathPopup.png | |
Wed, Nov 27, 9:59 PM |
Currently, the Extension:Popup preview is only working in SVG mode.
@FrederikHennecke1 Thank you for reporting.
To give you a rough overview of what is required to fix the issue, please find relevant links for becoming a MW hacker
Because the popup module is currently looking for image tags inside .mwe-math-element elements with data-qid attributes, and the MathML mode is not using any images or the data-qid attribute.
- Is there any output in the browser's console?
No.
- How is the situation with other browsers?
I just also tested in MS Edge 131.0.2903.70 and Safari 14.1. where it's also broken.
Change #1099091 had a related patch set uploaded (by FrederikHennecke1; author: FrederikHennecke1):
[mediawiki/extensions/Math@master] Fix Preview not working with MathML rendering
Change #1099091 merged by jenkins-bot:
[mediawiki/extensions/Math@master] Fix Preview not working with MathML rendering
Hi @FrederikHennecke1 and @Physikerwelt. I don't understand what the problem is. Can you link to the page where the problem appears? What did you do? What did you expect to happen?
As far as I can see, The only Math related test just checks if the formula is present on the page:
- If yes, can those tests be extended to cover the MathML popup?
Probably, but I don't really understand what should be tested.
Hi @zeljkofilipin, thank you for getting back to this.
Normally, if one visits https://en.wikipedia.org/wiki/Mass%E2%80%93energy_equivalence in a private window without any cookies or user settings, one sees popups for wiki-links and the first formula that has the property qID. See the screenshot in the ticket. The feature is currently broken: https://phabricator.wikimedia.org/T381310
It would be nice to have failing tests if the feature breaks.
In addition, the feature did not work depending on the user settings. It didn't work in MathML mode, especially. This was fixed by https://gerrit.wikimedia.org/r/1099091
Would that test live in Math or Popups repository? Does Math already have a dependency on Popups (or vice versa)?
As far as I can see, both Math and Popups don't declare any dependencies besides MediaWiki.
To create the test, I need a working popup. Which revision of which repository do I have to have locally to get the popup working? Is it working anywhere on a public wiki (beta cluster, patch demo...)?
Would that test live in Math or Popups repository? Does Math already have a dependency on Popups (or vice versa)?
I think it would live in math @Jdlrobson ? And there is no hard dependency as this feature is nice to have but not essential for any of the extensions.
@FrederikHennecke1 Can you document as a step-by-step guide what you did to get the popups working locally?
It's almost working on beta https://en.wikipedia.beta.wmflabs.org/wiki/T381046 despite that no property "in defining formula" seems to exist.
It's almost working on beta https://en.wikipedia.beta.wmflabs.org/wiki/T381046 despite that no property "in defining formula" seems to exist.
This works with the (old) has part way
Change #1101834 had a related patch set uploaded (by Physikerwelt; author: Physikerwelt):
[operations/mediawiki-config@master] Add new properties for math popups
Here are the steps:
$wgMathWikibasePropertyIdDefiningFormula = 'P308'; $wgMathWikibasePropertyIdInDefiningFormula = 'P311'; $wgMathWikibasePropertyIdSymbolRepresents = 'P310';
Here are my settings:
# End of automatically generated settings. # Add more configuration options below. $wgMaxArticleSize = 4096; $wgAPIMaxResultSize = 268435456; $wgShowExceptionDetails = true; wfLoadExtension( 'Math' ); $wgMathValidModes[] = 'mathml'; $wgDefaultUserOptions['math'] = 'mathml'; $wgMathMathMLUrl = 'http://12.23.34.45:10042/'; # IP of Mathoid server wfLoadExtension( 'Popups' ); wfLoadExtension( 'PageImages' ); wfLoadExtension( 'TextExtracts' ); wfLoadExtension( 'WikibaseRepository', "$IP/extensions/Wikibase/extension-repo.json" ); require_once "$IP/extensions/Wikibase/repo/ExampleSettings.php"; wfLoadExtension( 'WikibaseClient', "$IP/extensions/Wikibase/extension-client.json" ); require_once "$IP/extensions/Wikibase/client/ExampleSettings.php"; $wgWBRepoSettings['allowEntityImport'] = true;
Change #1101834 merged by jenkins-bot:
[operations/mediawiki-config@master] Add new properties for math popups
I think it would live in math @Jdlrobson ? And there is no hard dependency as this feature is nice to have but not essential for any of the extensions.
Yes ideally any tests would be in Math, which would be run by Popups on all patches.
Change #1105072 had a related patch set uploaded (by Krinkle; author: FrederikHennecke1):
[mediawiki/extensions/Math@REL1_43] Fix Preview not working with MathML rendering
Change #1105072 merged by jenkins-bot:
[mediawiki/extensions/Math@REL1_43] Fix Preview not working with MathML rendering