Last modified: 2014-11-02 12:46:53 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 T54661, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 52661 - Preprocessor should handle -{...}- variant constructs.
Preprocessor should handle -{...}- variant constructs.
Status: NEW
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
1.22.0
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 72010 (view as bug list)
Depends on:
Blocks: 41716 71815
  Show dependency treegraph
 
Reported: 2013-08-09 02:38 UTC by C. Scott Ananian
Modified: 2014-11-02 12:46 UTC (History)
7 users (show)

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


Attachments

Description C. Scott Ananian 2013-08-09 02:38:55 UTC
The preprocessor knows about links, so that (for example):

[[File:Foobar.jpg|caption with [[link|alt=foo]]]]

is parsed correctly.  However, it doesn't know about the -{ }- variant syntax.  As a result:

[[File:Foobar.jpg|-{R|caption}-]]

is *not* currently parsed correctly.
Comment 1 C. Scott Ananian 2013-08-09 02:39:40 UTC
From IRC:

07:36:15 PM) TimStarling: but it wouldn't be too hard to make the preprocessor annotate it, the same way it does with links
(07:36:33 PM) TimStarling: you know the preprocessor is responsible for expanding templates
(07:36:55 PM) TimStarling: but it marks up links for the sole purpose of getting correct template DOM
(07:37:28 PM) TimStarling: e.g. for parameter splitting in {{ a [[b|c]] }}
(07:37:45 PM) TimStarling: it would probably be beneficial for -{}- to be handled in the same way
(07:38:15 PM) TimStarling: then {{ a -{b|c}- }} would work in the intuitive way
(07:38:10 PM) cscott-free: yes.  i think i'm going to add [[File:foobar.jpg|-{R|rawcaption}-]] as a parser test and open a bugzilla for that.  for the future.
Comment 2 Gerrit Notification Bot 2013-08-09 02:58:30 UTC
Change 78330 had a related patch set uploaded by Cscott:
Add parserTests for language converter markup.

https://gerrit.wikimedia.org/r/78330
Comment 3 Liangent 2013-08-09 03:02:24 UTC
btw There's another wikitext snippet that isn't handled well currently:

;-{zh-cn:AAA;zh-tw:BBB}-

Is this resolvable with the preprocessor change?
Comment 4 C. Scott Ananian 2013-08-12 19:09:32 UTC
(In reply to comment #3)
> ;-{zh-cn:AAA;zh-tw:BBB}-
> Is this resolvable with the preprocessor change?

Yes, I believe this has the same root cause.
Comment 5 Gabriel Wicke 2013-08-14 00:39:06 UTC
(In reply to comment #4)
> (In reply to comment #3)
> > ;-{zh-cn:AAA;zh-tw:BBB}-
> > Is this resolvable with the preprocessor change?
> 
> Yes, I believe this has the same root cause.

Lists are not handled by the preprocessor. The issue here is that the list handler (doBlockLevels) is not aware of -{ }- either and (wrongly) recognizes the embedded colon as a single-line dt/dd pair.
Comment 6 C. Scott Ananian 2013-08-14 20:51:18 UTC
Right.  But if the preprocessor lifts out the -{...}- constructs, then doBlockLevels won't get confused.  So yes, same root cause.
Comment 7 Gabriel Wicke 2013-08-14 21:27:11 UTC
If you reintroduce language conversion blocks only after doBlockLevels is done, then you'll need to find a different way to parse the contents of those blocks independently of the main content.
Comment 8 Liangent 2013-08-16 07:05:51 UTC
One more thing being broken:

{|
|-
| -{R|B}-
|}
Comment 9 C. Scott Ananian 2013-08-26 18:53:12 UTC
Also:
-{zh-cn:[[Category:A]];zh-tw:[[Category:B]];}-

This shouldn't be in both A and B (should it?).  We don't want the category to depend on the variant.  So maybe it *should* be in both?
Comment 10 C. Scott Ananian 2013-08-26 18:56:44 UTC
I think it should be in neither.  (gwicke agrees.)

[[Category:foo]] would add it to the 'foo' category.  in a variant where foo=>bar, it might appear like [[Category:foo|bar]], and be edited that way by VE, but that wouldn't change the category of the page.  Category links inside -{...}- would be forbidden (that is, parsed as plain text).
Comment 11 Gerrit Notification Bot 2013-11-07 16:39:59 UTC
Change 78330 merged by jenkins-bot:
Add parserTests for language converter markup.

https://gerrit.wikimedia.org/r/78330
Comment 12 Andre Klapper 2014-11-02 12:46:43 UTC
*** Bug 72875 has been marked as a duplicate of this bug. ***
Comment 13 Andre Klapper 2014-11-02 12:46:53 UTC
*** Bug 72010 has been marked as a duplicate of this bug. ***

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


Navigation
Links