Page MenuHomePhabricator

Parse warnings not visible with live preview
Closed, ResolvedPublic

Description

Steps to reproduce:

There should be an error like Invalid or unsupported value for property background-image... but it's only visible when live preview is disabled.

Event Timeline

Tgr created this task.Mar 20 2018, 2:11 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 20 2018, 2:11 AM

[[https://www.mediawiki.org/w/api.php?action=help&modules=parse|action=parse&prop=parsewarnings]] can be used for getting the warnings wikitext (although it doesn’t yield anything for this particular page, but I don’t get any warning using the normal preview, either).

Tgr added a comment.Dec 5 2018, 7:09 PM

[[https://www.mediawiki.org/w/api.php?action=help&modules=parse|action=parse&prop=parsewarnings]] can be used for getting the warnings wikitext

It can but the live preview doesn't do it.

although it doesn’t yield anything for this particular page, but I don’t get any warning using the normal preview, either

Most warnings prevent saving the page (although I guess I could have made something that surpasses parser limits), which is why step 3 says to change the domain.

[[https://www.mediawiki.org/w/api.php?action=help&modules=parse|action=parse&prop=parsewarnings]] can be used for getting the warnings wikitext

It can but the live preview doesn't do it.

This is why this task isn’t already resolved. :) I just wanted to mention it to note that the API is ready and only the JavaScript side needs work.

although it doesn’t yield anything for this particular page, but I don’t get any warning using the normal preview, either

Most warnings prevent saving the page (although I guess I could have made something that surpasses parser limits), which is why step 3 says to change the domain.

Oh, somehow I missed that point. Anyways, I tested with other errors (now also with this one), so I can confirm it works on the API side. (Other tests also revealed that it returns wikitext rather than HTML, so it should be parsed once again before outputting.)

TheDJ added a subscriber: TheDJ.May 19 2020, 10:39 AM

I do have a patch for this.. somewhere...
I believe I never completed it, because i had wanted to use templated html instead, but then I never finished that rework.

Restricted Application added a subscriber: Liuxinyu970226. · View Herald TranscriptMay 19 2020, 10:39 AM

Change 597262 had a related patch set uploaded (by TheDJ; owner: TheDJ):
[mediawiki/core@master] warnings and header for livepreview

https://gerrit.wikimedia.org/r/597262

Nardog added a subscriber: Nardog.Sep 20 2020, 4:59 AM

Change 597262 merged by jenkins-bot:
[mediawiki/core@master] LivePreview: Show parse warnings and preview header/warning

https://gerrit.wikimedia.org/r/597262

matmarex closed this task as Resolved.Oct 15 2020, 3:43 PM
matmarex assigned this task to TheDJ.
Lofhi added subscribers: matmarex, Lofhi.EditedOct 24 2020, 10:00 PM

@matmarex & @TheDJ : hi, the MediaWiki message PreviewNote with parseDom() was added with commit, but LivePreview fails to parse it on frwiki. jqueryMsg.wikiTextToAst fails when it encounters the character {. It seems that wikitable syntax is not supported. Should the community edit the system message?

mediawiki.jqueryMsg: previewnote: Parse error at position 26 in input: <div id="previewnote-fr">
{|

@Lofhi I think we didn't anticipate that many wikis would have complex overrides for this message… For https://fr.wikipedia.org/wiki/MediaWiki:Previewnote in particular, the image would also be a problem. Only a small set of wikitext syntax is supported in messages that are used client-side: https://www.mediawiki.org/wiki/Manual:Messages_API#Feature_support_in_JavaScript

Looks like this is now filed as T266311, let's continue there. We should probably handle this message differently.