Page MenuHomePhabricator
Paste P11223

More P-wrapping comments.
ActivePublic

Authored by cscott on May 18 2020, 9:33 PM.
Tags
None
Referenced Files
F31832194: raw.txt
May 18 2020, 9:33 PM
Subscribers
None
This relates to https://phabricator.wikimedia.org/T134469
Two test cases here
https://en.wikisource.org/wiki/Template:Cl-act-p/testcases#Testing_start_and_end_version_for_higher_level
In the first example, there is a line-feed between the end of the template and the subsequent text. Given that no additional whitespace appears in the subsequent examples I am concerned that the P wrapping is being inserted in the wrong place. (Although it's feasible it's getting introduced as whitespace in a lower level template, I haven't been able to find yet.) Under normal rules (without the templates), no intervening blank lines means the line-feeds get collapsed.
What ideally should be happening is that the parser should somehow detect that the text is a continuation from the text inside the template call {{cl-act-p/1/s}} in this instance (no intervening block level elements), and move back the insertion point for the P to before the numbering. (I.e winds back the insertion point until it sees either the opening or closing of a DIV level element. Normal rules would then be followed.
How easy would a parser with this wind-back insertion behavior( albeit with a suitable lint warning) be to implement ?
(I am aware that DIV isn't the only element for which this wind-back behavior might need to be considered.).
--
This email was sent by ShakespeareFan00 to Cscott by the "Email this user" function at Wikisource.
In followup to my earlier message, I had another look at the underlying code and was able by some rather convoluted changes to it, I managed to make the P wrapping concerns go away :)
So my earlier comments can be ignored, unless you want to review the changes to the various underlying templates and a module here in order to figure out if there's some useful advice for other template and module writers.
Sorry... Sometimes when you are working on a problem for a while, you end up missing the small detail you'd otherwise have considered at first.