Page MenuHomePhabricator

Discussions within tag extensions?
Open, Needs TriagePublic

Description

I just developed a voting extension for the OpenStreetMap wiki. The gist is that you add the following wiki markup to a page:

<vote>
</vote>

and get the following form:

image.png (262×475 px, 21 KB)

Submitting the form just inserts a line before the closing </vote> tag.
My extension already supports replying to votes by editing the wikitext (the vote tallying simply skips any line not starting with * ).

I have asked the OpenStreetMap community for feedback and a common request was that it would be nice if my extension was compatible with the reply tool of Discussion Tools.

I think the idea would be to have for example the following wikitext:

<vote>
* <yes> This is a good idea. --[[User:Bob|Bob]] ([[User talk:Bob|talk]]) 09:27, 14 October 2022 (CEST)
* <no> I don't like this. --[[User:Alice|Alice]] ([[User talk:Alice|talk]]) 09:27, 14 October 2022 (CEST)
</vote>

However this does not appear to work with DiscussionTools (yet?). While the reply buttons are correctly inserted, attempting to reply fails with the error message:

Your comment could not be published to the most recent version of the page. To see the latest changes, copy your drafted comment and then use your browser to reload the page.

Looking at the respective DiscussionTools source code I found the comment:

// This is probably because changes were inside a transclusion's HTML?

Long story short: is this something that can be supported by DiscussionTools?

On a related note on the OpenStreetMap wiki votes take place prominently directly on the proposal page (as opposed to the proposal talk page), so would it be possible to enable DiscussionTools in a non-talk namespace?

Event Timeline

Long story short: is this something that can be supported by DiscussionTools?

In principle yes, if you implement support for editing the <vote> tags as HTML in Parsoid. I think you would be treading new ground, but it should work. You need to support this: https://www.mediawiki.org/wiki/Parsoid/Extension_API#Converting_DOM_to_wikitext. I'm not sure how stable this API is right now. I know that @ihurbain has worked on it somewhat recently, she might be interested in what you're building.

(And just for future reference, for anyone else reading this: you'll also need a workaround for T319221, but you already know that.)

On a related note on the OpenStreetMap wiki votes take place prominently directly on the proposal page (as opposed to the proposal talk page), so would it be possible to enable DiscussionTools in a non-talk namespace?

Yes, just add it to $wgExtraSignatureNamespaces in your site config.