Last modified: 2010-01-31 23:07:15 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 T20427, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 18427 - Comment (edit summary) parser option for API
Comment (edit summary) parser option for API
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.15.x
All All
: Normal enhancement (vote)
: ---
Assigned To: Roan Kattouw
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-04-10 19:27 UTC by Splarka
Modified: 2010-01-31 23:07 UTC (History)
5 users (show)

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


Attachments

Description Splarka 2009-04-10 19:27:53 UTC
Edit summaries (referred to as comments internally, see Linker::formatComment) have their own custom parser, which is possible to duplicate but rather annoying to get 100% correct (also, there are minute differences between versions of Mediawiki).

It would be nice to be able to parse edit summaries via the API in two methods:

1) add comment= parameter to action=parse, spitting out <parsedcomment> with the HTML

2) add &parsecomment to all properties returning unparsed comments, for example http://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=Foobar could have &parsecomment return: 
  <rev ... comment="/* Examples */ capitalization" parsedcomment="(&lt;span class=&quot;autocomment&quot;&gt;&lt;a href=&quot;/wiki/Foobar#Examples&quot; title=&quot;Foobar&quot;&gt;?&lt;/a&gt;Examples:&amp;#32;&lt;/span&gt; capitalization)" />

Not sure of the exact names, but internally and in the api they are called 'comments' rather than 'summaries'. In Linker the action is 'format' but api users will be used to 'parse' already.
Comment 1 Sam Reed (reedy) 2010-01-31 00:49:30 UTC
I've done part 1 locally.

Are we having it as comment, or as summary? Seemingly, we use a mix of both
Comment 2 Gurch 2010-01-31 04:17:12 UTC
(In reply to comment #1)
> I've done part 1 locally.
> 
> Are we having it as comment, or as summary? Seemingly, we use a mix of both

We use:

* 'summary' for actions 'edit', 'rollback' and 'import'
* 'reason' for lists 'blocks' and 'globalblocks' and all other actions except 'upload'
* 'comment' for action 'upload' and all other 'prop' and 'list' modules

so yeah... a mix :)
Comment 3 Sam Reed (reedy) 2010-01-31 11:55:32 UTC
Gurch, you've just made it EVEN worse :P

If it wasn't such a breaking change, i'd suggest we normalise one way or another, but i guess it's not gonna be a good idea...
Comment 4 Roan Kattouw 2010-01-31 14:35:11 UTC
(In reply to comment #3)
> If it wasn't such a breaking change, i'd suggest we normalise one way or
> another, but i guess it's not gonna be a good idea...

For breaking changes you'll need a better reason than aesthetics :)
Comment 5 Sam Reed (reedy) 2010-01-31 15:40:50 UTC
Oh Roan, you are boring ;)

Preference for this module then?
Comment 6 Roan Kattouw 2010-01-31 16:37:52 UTC
(In reply to comment #5)
> Oh Roan, you are boring ;)
> 
Yeah I'm good at playing a broken record. You should've seen my in my "File a bug" period.

> Preference for this module then?
I think 'summary' is the least ambiguous term.
Comment 7 Sam Reed (reedy) 2010-01-31 17:46:38 UTC
Good fun.

Part one done in r61747
Comment 8 Sam Reed (reedy) 2010-01-31 21:00:11 UTC
r61754 Adds parsed comments to prop=revision
Comment 9 Sam Reed (reedy) 2010-01-31 21:13:14 UTC
[21:05:01] <Reedy> hmm... maybe log events
[21:05:12] <Reedy> deletedrevs
[21:05:52] <Reedy> recentchanges
[21:06:08] <Reedy> usercontribs
[21:06:30] <Reedy> watchlist
[21:06:58] <Reedy> protected titles

Are all these needed/wanted?
Comment 10 Sam Reed (reedy) 2010-01-31 23:07:15 UTC
All fixed up in r61761

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


Navigation
Links