Last modified: 2012-08-08 00:19:33 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T40987, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 38987 - Wikitext to html parsing works QUnit test broken
Wikitext to html parsing works QUnit test broken
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Unit tests (Other open bugs)
1.20.x
All All
: Normal normal (vote)
: ---
Assigned To: Krinkle
: code-update-regression
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-02 20:23 UTC by Sam Reed (reedy)
Modified: 2012-08-08 00:19 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Image! (63.93 KB, image/png)
2012-08-02 20:51 UTC, Sam Reed (reedy)
Details

Description Sam Reed (reedy) 2012-08-02 20:23:20 UTC
Or locally at least:

.
Expected: 	
"<p><b>Hello world</b></p>"
Result: 	
"<p><b>Hello world</b>
</p"
Diff: 	
 "<p><b>Hello world</b></p>" world</b>
</p"
Comment 1 Krinkle 2012-08-02 20:40:46 UTC
This was already fixed a few days ago.
Comment 2 Sam Reed (reedy) 2012-08-02 20:42:11 UTC
(In reply to comment #1)
> This was already fixed a few days ago.

Has it not been submitted yet?
Comment 3 Krinkle 2012-08-02 20:44:41 UTC
Yes it has, and it was merged. Tests are passing on current stable mediawiki/core master HEAD.
Comment 4 Sam Reed (reedy) 2012-08-02 20:49:16 UTC
(In reply to comment #3)
> Yes it has, and it was merged. Tests are passing on current stable
> mediawiki/core master HEAD.

They're not on my dev wiki (hence opening this bug)...

diff --git a/tests/qunit/suites/resources/mediawiki.api/mediawiki.api.parse.test.js b/tests/qunit/suites/resources/mediawiki.api/mediawiki.api.parse.test.js
index 246b74a..f33edb0 100644 (file)
--- a/tests/qunit/suites/resources/mediawiki.api/mediawiki.api.parse.test.js
+++ b/tests/qunit/suites/resources/mediawiki.api/mediawiki.api.parse.test.js
@@ -9,7 +9,7 @@ QUnit.asyncTest( 'Simple', function ( assert ) {
        api.parse( "'''Hello world'''" )
                .done( function ( html ) {
                        // Html also contains "NewPP report", so only check the first part
-                       assert.equal( html.substr( 0, 26 ), '<p><b>Hello world</b>\n</p>',
+                       assert.equal( html.substr( 0, 25 ), '<p><b>Hello world</b></p>',
                                'Wikitext to html parsing works.'
                        );
Comment 5 Sam Reed (reedy) 2012-08-02 20:50:11 UTC
I still get the newline, which leads to the character truncation
Comment 6 Sam Reed (reedy) 2012-08-02 20:51:35 UTC
Created attachment 10925 [details]
Image!
Comment 7 Sam Reed (reedy) 2012-08-02 21:15:56 UTC
Fails for Hashar also
Comment 8 Krinkle 2012-08-02 23:06:23 UTC
This unit test was failing for several weeks due to a non-js change (maybe someone changed the Parser and/or ApiParse?)

So then I fixed the unit test to no longer expect the line break between </b> and </p>. I always found it strange that it was inserted so this seemed like a fix.

Now you're saying it is back for you? It is passing for me (in Chrome).
Comment 9 Krinkle 2012-08-03 00:50:14 UTC
Roan tested it on his machine and it is working there as well (he tested both the qunit test as well as accessing api.php?action=parse directly. In both cases there is no new line character inserted.

He also tested it on en.wikipedia.org, works there too.
Comment 10 Krinkle 2012-08-03 00:50:55 UTC
So it turns out that it is failing/passing based on presence of Tidy.

Tidy removes the line-break that MediaWiki outputs between </b> and </p>.

I'll fix the test for now to parse the html and compare the dom instead of the html.
Comment 11 Krinkle 2012-08-08 00:19:33 UTC
I62e39e0b05e3f9b5f78e2ac28a6f3ca0b608d152

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links