Commit Graph

74 Commits

Author SHA1 Message Date
lyrianos93 946a18d14c Implement datatype 'Math' for Wikidata
This change implements all components to use the datatype 'Math' in Wikidata.
Because 'String 'is used as value type, only the Formatter and Validator are needed to be implemended.

The components are:
* hooks
* Formatter class
* Validator class
* Test cases

Bug: T67397
Change-Id: Ic64fd6c8560f48052e2db24ae1f013d48a82b5e9
2016-01-11 22:29:29 +00:00
Željko Filipin 30fd1cb9b3 Update mediawiki_selenium Ruby gem to the latest version
Bug: T114241
Change-Id: I81a6727fba46a0c9a628c0718e6159cfc8846c22
2015-12-17 12:58:34 +01:00
jenkins-bot dd06d7ed94 Merge "browser test: fix logic to find edit action" 2015-12-15 09:22:44 +00:00
Marko Obrovac c3ebc54994 Minor: rename checkTex() to checkTeX()
Change-Id: I9b1860562b2f4f2112b68c0c3d6f0390f0405fbe
2015-12-14 23:58:08 +01:00
Antoine Musso 0cebe64840 browser test: fix logic to find edit action
The simple math test failed to find the edit link on a non existent
page. It was looking for the text 'Create source' from Vector which is
now simply 'Create'.

Change the PageObject selector to use a CSS selector, more robust to
text changes.

Change-Id: Ifcbd07da8e343b5697fcff6af6ffac90ff4d6420
2015-12-14 21:24:13 +01:00
physikerwelt 897afa480b Use RestBase to check input tex rather than texvccheck
* This will increase the performance of tex rendering for all
 rendering modes since no shell access is required anymore.

 Merge with caution. If the connection to restbase fails, rendering
 of new formulae will be completely disabled i.e. broken.

Change-Id: I1982612e8c6a356e3dbdf447724ac82e5968cc77
2015-12-03 09:03:43 +00:00
physikerwelt f63eaeac23 Restbase based texvc input check
This change only connects the restbase and the mathinput interfaces
but does not change any functionality.

Change-Id: I3a23e5008c26c5f14ad842dcb5d22906a8aff33c
2015-12-03 08:56:47 +00:00
physikerwelt c66a85f143 Fix error in checking logic
Tex validation should be skipped if checking is disabled.
Consequently if 'disable tex filter' is set to 'never' it's a double
negation and tex should always be checked.
If 'disable tex filter' is set to always, never check tex.

Change-Id: Ic6fda8016838eae03a0ed36e3d8d4f35423ba8b1
2015-12-03 08:30:24 +01:00
physikerwelt 6ef2e56439 Add Restbase interface
* Add a simple interface to Restbase that currently
  does not do anything.

Change-Id: I4c2ef329b3954fd35276a5e270d0dc3fcacabf7b
2015-12-01 21:10:09 +00:00
paladox df8ad1c799 Add php code sniffer to composer
Add support for php code sniffer

Change-Id: I7dcdd88be4f1f8219f71ab770979284761e09bae
2015-09-23 10:46:14 +01:00
Željko Filipin 646fc8e94b Fixed Style/StringLiterals RuboCop offense
Bug: T111184
Change-Id: Ia51f271b5e06d7bbd9896634b832003d57c30900
2015-09-22 10:18:13 -07:00
Željko Filipin 2bda4398f4 Fixed Style/SpaceInsideHashLiteralBraces RuboCop offense
Bug: T111184
Change-Id: I77573a78136dc9a8fd6f8b7364e23c8bf6db5e7f
2015-09-22 10:18:13 -07:00
Željko Filipin 4e4baedb2b Fixed Style/SpaceAroundOperators RuboCop offense
Bug: T111184
Change-Id: I442e5be94459d5a8bb497edad9fca900c4066ba1
2015-09-22 10:18:13 -07:00
Željko Filipin f85439cce9 Upgrade browser tests to use mediawiki_selenium 1.x
Bug: T99656
Change-Id: Ie170d38082d7441df8014ae97f1be820e21871fd
2015-09-22 10:18:13 -07:00
physikerwelt bc52c77d24 Use extension.json, empty PHP entry point
* Use string constants instead of integers
* Derive new names from old via conversion of constant
  naming convention to CamelCase.
* Replace old constant string e.g. 'MW_MATH_ABC_DEF'
  with new string 'abcDef'
* Replace old constant value with new string.
* Tests to demonstrates what is actually done.
* Rename constants

Bug: T106630
Bug: T106631
Bug: T87941
Change-Id: I6d1094ece79e912d9ddbef6681a25196c7a6e801
2015-07-30 22:01:20 +00:00
physikerwelt 5c12ed983f Remove useless debug functionality
* MathDebug was intended to provide advanced debugging functionality
  for the math extension. However, the interesting debugging and
  logging feature never made it from the debug branch to the master.
* The current debug functionality is mostly useless. Only some values
  are written to memory and never used thereafter.
* This change moves the existing functionality to the MathSearch
  extension and introduced the required hook for that.

Details:
* $wgMathDebug is removed
* A new Hook MathRenderingResultRetrieved is created
* The math rendering object is printed to the svg error
  page if wgDebugComments is active (instead of wgMathDebug)

Change-Id: I6fad69b5d9b9ca8a7d12c7e410d3ae6180fbddbf
2015-07-14 10:34:37 -04:00
physikerwelt (Moritz Schubotz) 6889086753 Move integration tests to a new special page
The integration tests depend on the presence of external servers
and the user settings.
First, people are bothered by  failing test due to problems with
those servers and second, administrators need to run phpunit tests
to verify the configuration settings.
Therefore, we move the integration tests to a special page.

Bug: T87389
Change-Id: If66f13fe7fa16868cd4b1d8f0e0a6e3d49448b27
2015-03-30 11:47:31 -04:00
Bryan Davis 81dbee82c9 Fix PHPUnit provider name
MathCoverageTest::testProvider -> MathCoverageTest::provideCoverage

'test*' reserved for PHPUnit tests and have to make assertions.

Change-Id: If46684eb27a2282b4cd6261bd0a19dba9bc20e27
2015-03-18 17:16:27 +00:00
Kunal Mehta 5a50bb312c Remove U+FEFF before opening <?php tag
Change-Id: Ib2f1a75f4a3b5879809243cf43124bf3ebf83127
2015-03-12 11:50:11 -07:00
jagori 197bd9ccd6 Refactor code for RSpec3 expect syntax incorporation
Bug: T68369
Change-Id: I25e27d8b363957c4217eaf8516d3c9e61ece156e
2015-02-08 18:52:38 +00:00
Timo Tijhof 83da0338ec Minor clean up, optimisations and documentation corrections
* Handle-error-first approach for consistent function body
  termination at the root with the main intend, and less indention.

* __DIR__ instead of dirname( __FILE__ )

* Single quotes.

* Correct pickHost documentation: wgMathMathMLUrl is not an array,
  and is not used in this method, that's at a different level
  of abstraction (via the constructor).

* White spacing.

* require_once is not a function.

Change-Id: Id4bec8415893245e2569a39ab5406a0820238ae4
2015-01-22 10:56:16 -08:00
physikerwelt (Moritz Schubotz) 056e85afe6 Update LaTeXML test
* The LaTeXML server was updated. In the new version unneccary id's
  have been removed.

Change-Id: I25927912f1500ebfe6d61505c0e06ae2c24d6f6a
2015-01-15 11:13:40 +01:00
physikerwelt (Moritz Schubotz) fd8eb448a3 Update MathParser tests
In the most recent version of ubuntu14 the outputhash of the
png images for some math objects has changed.
However, the rendered images seem to look ok.

Bug: T86309
Change-Id: I52dbdefdcfa19c10f1d9d1a43369aabe8bfd92bf
2015-01-10 14:54:03 +00:00
Ori Livneh d9b9b06032 MWException -> Exception
Change-Id: I18da1baeb70387b96e30811a049185a264dec26d
2015-01-09 17:55:54 -08:00
physikerwelt (Moritz Schubotz) 7c5ce98bfa Fix Mathoid integration test
A recent change in mathoid, i.e. 
I8d3cec0ee8a8c9368b7dca89e1d5e0c5683f946c 
removed the margins. This causes breaking unit tests.

Change-Id: I312d6226c6f24c84254b99ee6292564a421133c3
2014-11-24 19:16:04 +00:00
Željko Filipin ce58cbc738 Prepare repository for running RuboCop after every push to Gerrit
For now ignoring all problems.

Bug: 69245
Change-Id: Id1164187eddc6dcb006ca771d62ca867677213f9
2014-10-21 15:04:22 +02:00
Reedy 672df7dcc8 Fix file permissions
Bug: 71941
Change-Id: I7b0eddc0ca679cf233ef29dcdfeca024ecc71d38
2014-10-15 12:16:20 +00:00
Frédéric Wang 3d0b787cbe Move vertical-align back to ext.math.css
This improves If8ee1cf6453257a0a2f6aa186d4007954a8e5d8e

Change-Id: I794b39a5d322a92d9f722ded790e213803448127
2014-10-12 18:22:06 +00:00
C. Scott Ananian 7914fbea61 MathCoverageTest: encode test file using JSON instead of PHP serialize.
This ensures that changes to the test inputs or outputs yield readable
diffs when reviewing.

Change-Id: I7b4ef8102ad7fbf7c289a27db60f304a140b93a5
2014-10-12 18:02:50 +00:00
Frédéric Wang 61a3d9c719 Merge "Revert "Disable failing latexml integration tests"" 2014-10-11 17:20:00 +00:00
Physikerwelt 2a20654ab9 Revert "Disable failing latexml integration tests"
This reverts commit 4c544f002b.

Change-Id: Ifafb5782e10e80240a282beb449ab069ad93c37f
2014-10-11 19:17:29 +02:00
physikerwelt (Moritz Schubotz) ccc4114812 Fine grained options for wgMathDisableTeXFilter
Add new option to filter only new input.
Now the complete list of possible settings is:
MW_MATH_CHECK_ALWAYS  backwards compatible to false
MW_MATH_CHECK_NEVER   backwards compatible to true
MW_MATH_CHECK_NEW     new option

Change-Id: I455b41c8b8d918f4c34f6c115194d227a8394e0a
2014-10-10 18:27:04 +00:00
Gabriel Wicke 4c544f002b Disable failing latexml integration tests
Change-Id: Ib0ea79155f87f036464756b3d303048f8df84897
2014-10-08 17:45:24 -07:00
physikerwelt 21c89c22b1 tests: Add missing parent::tearDown() call
Follows-up 6a0af8f3b4.

Change-Id: I9418205479053c4129b6a9b888e38150799edcc5
2014-09-16 00:50:30 +00:00
Cmcmahon c31fe814be QA: update to fix deprecated API token call
Change-Id: I8654964a86c1154a6c7b14fc46235da5738a0985
2014-08-27 16:28:40 +00:00
addshore a47620df7e Use public instead of var in classes
Change-Id: Id7d5c9e609e20d7b1d5ef68101770f57d6f183c6
2014-08-17 22:09:06 +01:00
Max Semenik 130c3f44f1 @group Math where it's missing
Change-Id: If8ec86c4b70d7d78d30cab6f9529af1cd0c2ea52
2014-07-25 15:09:30 -07:00
physikerwelt f2dff6574b Fix: id-attribute
Id attribute was read wrong place

Change-Id: I6f2671a322f637a1d8e0c88833ce4456d188829b
2014-07-25 17:18:45 +00:00
physikerwelt (Moritz Schubotz) 5e2c1c5101 Displaystyle in Mathoid 0.2.5
Beginning from mathoid 0.2.5 displaystyle is the default
option. This property has to be removed as default.

Change-Id: I3c176f4227f32709f6db4014e1e3b435c3c853c4
2014-07-20 00:00:43 +00:00
physikerwelt 147ffa2307 Fix broken unit tests
Unit tests fail because the inner structure of the
SVG image that is gernerated by the Mathoid server
has changed.

Change-Id: I49d3116ee36b0a7a776df75656706d54bf04e961
2014-07-19 21:21:17 +00:00
jenkins-bot 4eebc40812 Merge "Fix MathDatabaseTest" 2014-07-11 01:37:18 +00:00
physikerwelt (Moritz Schubotz) cac44883d3 Fix MathDatabaseTest
The test used an unnecessary call to
setupTestDB. This might have caused
that the unittest_math table was deleted
twice during the setup routine of the
unittest.

Bug: 67148
Change-Id: I4a414900c1c2d97b759ef1755e53e82c5c2e8e14
2014-06-30 10:52:03 +00:00
Cmcmahon 94ded6c7b9 Port browser test for Math extension from the /qa/browsertest repo
From an earlier discussion with physikerwelt.

This is one step toward retiring the /qa/browsertest repo
entirely.

Change-Id: I804f32d2a5a984c8eb0dfc50c8ab50a7f1035256
2014-06-27 22:31:56 +00:00
physikerwelt (Moritz Schubotz) cbbf5453d1 Enable MathML rendering mode
This change allows to registered users
to test the new MathML rendering mode.
Invalid settings for math rendering mode
will default to MathMathML.

Change-Id: I75f24cb762609d6728247e3758fcc18f2ebfc6e6
2014-06-11 13:21:34 +02:00
physikerwelt 65642489ae Separate render and getHtml
Currently the method render always returns
a html string that can be a string that
represents the correct result or a rendered
error message.
This change splits rendering and
fetching of the HTML output.
This simplifies the logic of the rendering
and caching mechanism.
Now the render method returns a boolean that
indicates if the rendering was sucessful or
not.

Step 2/2

Warning: Errors in this change might affect
caching logic and squid caches.

Change-Id: I00502b84212ed70cdf63bd69916a35afbd6fdbc1
2014-06-09 23:21:44 +02:00
physikerwelt c390f6479a Add getHtmlOutput method
Currently the method render always returns
a html string that can be a string that
represents the correct result or a rendered
error message.
This change adds a mechanism that allows
to fetch the HTML output.
In a followup commit the rendering function
is changed to return a boolean value rather
than the rendering result.
This will simplify the error handling and caching.

Change-Id: I80760493e391911c41eb69d75a93c6a34db8852e
2014-06-06 21:52:35 +02:00
physikerwelt (Moritz Schubotz) 52656990b4 MathMathML
The LaTeXML class contains some code that is
not specific to LaTeXML but to MathML.
This code can be shared between LaTeXML and Mathoid.
This change introduces a new class called MathMathML
and moves the shared code from the LaTeXML class to this
new class.

Bug: 65973
Change-Id: I50517ba83f9a0d2aa8e237f062f18e4319ddbac8
2014-06-05 09:06:33 +00:00
physikerwelt (Moritz Schubotz) c7197bee19 Add separate database table for LaTeXML (step 5)
Currently the PNG and the LaTeXML rendering mode
use a common table in the database. If both rendering
modes are allowed in a wiki simultaneously this causes
problems, because the fields are continuously overwritten.

This is patch changes the logic of the rendering
engine to use the specific database.
The caching logic is now simpler to understand.
A entry is written to the database if the changed field
of the MathRenderer class is true. Is is triggered by the
setters of the database relevant fields.


Bug: 65522
Change-Id: Ief9de889b9292b21c9d1529a8b1797f38196edad
2014-05-31 10:34:21 +00:00
physikerwelt bf33d51320 Add separate database table for LaTeXML (step 3)
Currently the PNG and the LaTeXML rendering mode
use a common table in the database. If both rendering
modes are allowed in a wiki simultaneously this causes
problems, because the fields are continuously overwritten.

This change adds the method getMathTableName that will
allow renderers to access their specific table in the
database.

Change-Id: I8b11ffd0a39fadd7d3c8de1e94e74ff5f490430d
2014-05-27 05:33:20 +00:00
physikerwelt 972cee0f98 Add separate database table for LaTeXML (step 2)
Currently the PNG and the LaTeXML rendering mode
use a common table in the database. If both rendering
modes are allowed in a wiki simultaneously this causes
problems, because the fields are continuously overwritten.

This change creates the new database table defined in step 1.

Bug: 65522
Change-Id: I5f125d36b83776ca6f75ff014dc9095d0a737a35
2014-05-21 17:23:42 +00:00