Page MenuHomePhabricator

Partial transclusion of pages fails with composite section names
Closed, ResolvedPublic

Description

Author: teak.wiki

Description:
If a page contains a section with name "A", and the following section is named "A B", then transcluding the first section (fromsection="A" tosection="A") will also append the following section (and anything else that has a composite name "A something"). Although this can be circumvented by renaming the following sections "A_B" or something similar, it seems to be a bug, and these type of section naming is quite common with dictionaries, encyclopedias and the like (following the article names).

Here is an example: http://hy.wikisource.org/w/index.php?title=%D5%80%D5%8D%D5%80/%D4%B1%D5%A2%D5%A2%D5%A1%D5%BD&action=edit
with transclusion from the page: http://hy.wikisource.org/w/index.php?title=%D4%B7%D5%BB:%D5%80%D5%A1%D5%B5%D5%AF%D5%A1%D5%AF%D5%A1%D5%B6_%D5%8D%D5%B8%D5%BE%D5%A5%D5%BF%D5%A1%D5%AF%D5%A1%D5%B6_%D5%80%D5%A1%D5%B6%D6%80%D5%A1%D5%A3%D5%AB%D5%BF%D5%A1%D6%80%D5%A1%D5%B6_%28Soviet_Armenian_Encyclopedia%29_1.djvu/16&action=edit


Version: unspecified
Severity: minor

Details

Reference
bz49376

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:04 AM
bzimport set Reference to bz49376.
bzimport added a subscriber: Unknown Object (MLST).

This come from the behavior of section transclusion, the correct way to tag section is <section begin="A B" /> which expand to "A B" , actually you use A B --> <section begin=A B /> which create a section named A. I'm unsure if it's the intent of the labeled transclusion or a bug ( http://www.mediawiki.org/wiki/Extension:Labeled_Section_Transclusion ). I'll modify the javascript which handle <section --> ## to add/remove transparently the needed quote "", once done you'll need to do a dummy edit on such page so the needed "" will be added (or you can add it now manually).

teak.wiki wrote:

I see!

Strange that the mediawiki page of the labeled transclusion extension doesn't include quotation marks in its example...

An automatic way of adding missing quotation marks would be nice indeed. Thanks.

Fixed by http://wikisource.org/w/index.php?title=MediaWiki:Base.js&diff=355722&oldid=351238 . As I can't reproduce this problem on my local wiki, I let this bug open and changed Component from ProofreadPage to LabeledSectionTransclusion. Anyone know if tag attribute parsing changed recently or the section transclusion code changed so <section begin=A B/>... is now transcluded by a {{#lst:...|A}} ?

Closing, double checked it and LabeledSectionTransclusion was already working this way.

teak.wiki wrote:

Thanks! The javascript worked well. Is there any way to implement this where the substitution section_name to <section begin=section_name/> happens? So that the automatic addition of quotation marks works out of the box in all wikis?

thanks again for looking into this.