Jump to content

Module talk:Excerpt/Archive 3

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Lowercase sigmabot III (talk | contribs) at 06:45, 13 January 2023 (Archiving 1 discussion(s) from Module talk:Excerpt) (bot). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Archive 1Archive 2Archive 3Archive 4

Undefined referenes through excerpt

I'm trying to sort out why 59th Venice Biennale gives errors about the reference "Artnews" being undefined. The text (and the reference definition) are brought in by {{excerpt}} from List of national pavilions at the 59th Venice Biennale. The source artilce renders without error, and I've done some poking at it to try to figure out what's wrong ... but nothing makes a fix.

Anyone able to help me sort it out please? - Mikeblas (talk) 22:38, 25 April 2022 (UTC)

References from quoted articles have the article name prepended, in this case <ref name="List of national pavilions at the 59th Venice Biennale Artnews">. This is to prevent clashes when both articles use the same name (commonly <ref name=":0"> etc.) for different citations. Certes (talk) 23:28, 25 April 2022 (UTC)
Is that relevant here? I don't think it is becuawe 59th Venice Biennale doesn't invoke any references defined in the excerpted text. -- Mikeblas (talk) 01:06, 26 April 2022 (UTC)
Partly. The problem seems to be that some of the citations use just name="Artnews" but others use name="Artnews" group="". The name isn't being changed when it appears with group="". Pinging Sophivorus. Certes (talk) 09:59, 26 April 2022 (UTC)
I must be missing something; all the usage I see is <ref name="Artnews"/>, without a group name attribute (not even a blank one). -- Mikeblas (talk) 13:50, 26 April 2022 (UTC)
No, I was missing something. I put {{excerpt|List of national pavilions at the 59th Venice Biennale|National pavilions}} through Special:ExpandTemplates and noted that some ref tags had group="" and didn't get a prefix. I hadn't spotted that they were expansions of {{r}} in the original article. That no longer happens now that the article contains a workaround. Certes (talk) 14:44, 26 April 2022 (UTC)
Observation: it seems to work fine when it came across more named references, such as <ref name="Artnews"/>, but fails when it is trying to call the reference via {{r|...}} on the remote article. I replaced one instance of r with the declaration and the problem went away. For your immediate need @Mikeblas: you could do the rest of those, as in Special:Diff/1084771632. — xaosflux Talk 14:05, 26 April 2022 (UTC)
That works! Sorry, I thought I had already removed uses of the {{r}} tempplate -- except for the invocations which were commented away. So it looks like the problem is that {{excerpt}} is simply incompatible with {{r}}. -- Mikeblas (talk) 14:10, 26 April 2022 (UTC)

Template-protected edit request on 17 May 2022 - Rare section edge-cases

Note: This is actually a dual edit request, with the pages in question being both Module:Excerpt and Module:Transcluder. Im only going to do 1 edit request to avoid polluting anything.

This is a potential fix for the transcluder and excerpt not correctly recognising a section's name if it contained a #. Note that while the testcases for excerpt have shown this change should be perfectly fine, I would preferably like a comment from anyone who knows more about this module than me to mention if there was a reason for ([^#]*) over (.*) (if any) before a TE or other implements this, as it feels odd enough to potentially be intentional.

The relevant fixes are on the sandbox for each page. The main excerpt testcases can be found here and the examples of it successfully working with the # are visible on my test page. Note that /testcases3 is claiming that there are differences between the 2 versions on some examples. After using safesubst to get the exact content and using a comparison tool, no difference was noted. Im not entirely sure what has happened there.

Thanks. Aidan9382 (talk) 21:17, 17 May 2022 (UTC)

@Aidan9382 Done, thanks for the fix and careful request! BTW, the issue with /testcases3 has been there for a long time and seems caused by Template:Test case table Sophivorus (talk) 21:15, 18 May 2022 (UTC)
Thanks for implementing! That testcases bug feels very odd to be happening, but thanks for letting me know. Might take a look at it, who knows. Aidan9382 (talk) 04:31, 19 May 2022 (UTC)
@Sophivorus: Thanks for bringing that whole /testcases3 issue has been happening for a while thing. Been working on that module for the past hour or so, and it really needs some slight bug fixing. The UNIQ--QINU detection was the issue here (fixed now), but the nowiki and nowiki+ output options are apparently not doing so good and making the diff checker think this isnt right (Maybe its somehow skipping normalisation?), so i guess ive got something to focus on now. Aidan9382 (talk) 05:32, 19 May 2022 (UTC)
@Aidan9382 Awesome, I didn't know you were working on that module! The testcases look green already, so thanks, nice work! Sophivorus (talk) 11:26, 19 May 2022 (UTC)

Template-protected edit request on 29 May 2022 - Blacklist fix

In the /config, protection padlock (pp) templates are considered blacklisted. However, the current regex, [Pp]p%-.+, catches all protection templates except the core {{pp}} one. To fix this, change

'[Pp]p%-.+',  -- {{pp-move-indef}} etc.

to

'[Pp]p', '[Pp]p%-.+',  -- {{pp-move-indef}} etc.

The reason its over 2 different regexs is because simply doing [Pp]p.* might be a bit too aggressive, and its easier to stay on the safe side of things. Thanks. Aidan9382 (talk) 21:18, 29 May 2022 (UTC)

 Done. P.I. Ellsworth , ed. put'r there 00:18, 30 May 2022 (UTC)

Recent change?

Has there been a recent change to the module - I'm noticing pages that previously worked are once again getting the error "The time allocated for running scripts has expired" --Find bruce (talk) 22:52, 28 May 2022 (UTC)

Always link to an example page when you are reporting a possible problem. – Jonesey95 (talk) 23:50, 28 May 2022 (UTC)
Thanks for the reminder. An example is Electoral results for the district of Bathurst, but the problem exists in virtually every article in Category:New South Wales state electoral results by district. You will note that every election prior to 1930 uses transcluded sections rather than the template. This was done in December 2021 [1] to deal with the error. Find bruce (talk) 02:21, 29 May 2022 (UTC)
@Find bruce: This issue has existed for a while - ive noticed quite a few election articles that have had this error for a while. As for recent changes, no. This module and its main associated module (Module:Transcluder) have had no significant changes that would affect performance. Pages can just sometimes take longer or shorter to load each time you save a page with Excerpt. Hope this helps. Aidan9382 (talk) 03:58, 29 May 2022 (UTC)
Thanks @Aidan9382: - the issue never arose when I first started using the module in June 2020 & first appeared around August last year. I edited all 350 articles to implement a work around. I will wait to see if anyone has a solution, otherwise I will simply give up on the module & go back to my previous template approach for all but the most recent elections - it's not as elegant & there are traps for the unwary that the module avoids, but it works with fewer resources. Find bruce (talk) 05:48, 29 May 2022 (UTC)
@Find bruce: There seem to have been quiet a few changes to the Transcluder last year august, but I don't see any differences that could be major. If your having to implement a fix for 350 pages, then I think it might be time this module set had a performance look-over, as that could cause a bit of confusion for passing editors. I'll take a look, see if I can find any performance improvements, but for now, I guess the template approach will have to do. Aidan9382 (talk) 05:59, 29 May 2022 (UTC)

@Find bruce: - Just came across an interesting discovery. It turns out that one of the main expensive calls (as in a third of the entire lua runtime) is to do with it trying its hardest to find files. Of course, in this situation, files are not gonna be relevant (at least I doubt it). Adding |files=0 to all the excerpts on a page should significantly improve the performance, and infact should be good enough to remove lua timeout errors in 99% (or 100% if we are lucky enough) of scenarios. Give it a shot, tell me how it goes. Aidan9382 (talk) 07:45, 29 May 2022 (UTC)

I haven't investigated the current code but it may be worth looking at Transcluder.removeNonFreeFiles(). A previous version of the module (now forked for use in portals) spent a lot of its time opening every file's rationale to check whether it could be included, and there was no obvious way to do that more efficiently. Certes (talk) 18:28, 29 May 2022 (UTC)
@Certes: While I could easily see that becoming a quick problem (just the sound of it makes me concerned), that unfortunately isn't the issue here. Transcluder.removeNonFreeFiles is only ran if any files are found. The issue here is the fact its going to extents much further than whats worth it to attempt to find files unless explicity told not to, and that is leading to another expensive Transcluder.get call. I will note that there may be reason for concern, as I've just noticed the code only attempts to remove Non-free files if found in blacklisted templates (Not a common scenario. I can explain further if required). Do you think this is worth looking into as another potential issue with this module? Thanks! Aidan9382 (talk) 18:36, 29 May 2022 (UTC)
@Aidan9382: I think the "blacklisting" is just another way to specify files, e.g. files=-2 means all files except the second, and behaves just like files=1,3-999. The check looks unchanged from the portal version except that it's also checking Commons, which may be unnecessary as Commons doesn't accept non-free content. It would be nice if we had an inexpensive isFileNonFree method, but sadly we do need to read the text; people got very upset and started deleting transclusions when we didn't. However, as you say, this may be a red herring as that code only runs when a file is found. Certes (talk) 19:38, 29 May 2022 (UTC)
Thanks @Aidan9382: I have added |files=0 to all the excerpts in Category:New South Wales state electoral results by district & it appears to have fixed all of the current timeout issues. Find bruce (talk) 08:56, 30 May 2022 (UTC)

Expensive calls and why excerpt runs so slow

During some recent testing, I was giving a prod at some of the parts of excerpt, and I noticed a section to do with desperately trying to grab files from anything we might have missed if a file cant be found initially (Lines 152-173). After excluding the content during some testing and some show preview usage, I noticed the execution time dropped by about 42% (Average 7.4438s -> Average 4.304s). As expected, the actually troubling part of that is probably the second Transcluder.get() for just templates. However, I am running very short on solutions, so I was wondering: Could someone give their opinions on:

  • The usefulness of having this to run by default,
  • The usefulness of this code section in general (why only try if we couldnt get files normally? Why does this make the infobox invaluable?), and
  • Any solutions that could either prevent calling it too often or improve the calling of it

I have a solution idea in mind, however the elegance of it is very low and is quite a hacky idea that would probably be a bad move, so input from others would be nice. Aidan9382 (talk) 18:26, 29 May 2022 (UTC)

@Aidan9382 Amazing find!! The usefulness of the feature is basically that many articles (perhaps even most) have their main image in the infobox, so this code tries to salvage it. It's inefficient, messy and even unreliable, I agree, but also useful and perhaps even expected at this point. That being said, I think I have an idea on how to fix it! I tried to implement it here but I couldn't quite finish (it's late and I can't find a good way to debug!). Basically the idea is to avoid entirely the second call to get() which essentially fires a second request and is probably the main cause of the performance loss. @Certes The call to removeNonFreeFiles also fires a request and may be causing a performance loss, so I'm thinking that given that all the trouble you had was in portals, we can maybe disable this feature on the mainspace by default, and only enable it on a case-by-case basis when required, thus avoiding the performance loss. Sounds like a plan? Sophivorus (talk) 21:26, 30 May 2022 (UTC)
@Sophivorus: Disabling the check in mainspace is worth a try. We need the current behaviour (in Module:Excerpt/portals, not Module:Excerpt) for portals because many of them display an excerpt from one article picked randomly from a long list, and no one checks them all to see if one has a blurry movie still that will bankrupt Hollywood if displayed. Certes (talk) 21:38, 30 May 2022 (UTC)
@Aidan9382 @Certes I think I nailed it (see Module:Excerpt/sandbox). I still have to fix a few minor issues, but would you mind checking if the effort was worth it, Aidan9382? (I have no idea know how to benchmark Lua modules.) Thanks! Sophivorus (talk) 23:23, 30 May 2022 (UTC)
@Sophivorus: I don't know the current code well enough to review it properly but that change to checking freefiles looks like what you need. (I'm interpreting that flag as "limit to free files only?".) For a quick benchmark, I preview with a relevant page, view the source code (Ctrl-U on Firefox) and search for "NewPP limit report". That shows how close we are to various limits (rarely a problem except in portals) and gives timings for various templates and Lua functions. Certes (talk) 23:36, 30 May 2022 (UTC)
@Certes Awesome! Well, judging by the "NewPP limit report" for Electoral results for the district of Bathurst it seems the sandbox version is far superior (~ 6 secs vs ~10 secs)! I'll wait for Aidan while I fix the remaining issues and deploy in a day or two, cheers!! Sophivorus (talk) 00:12, 31 May 2022 (UTC)
@Sophivorus: I've gone ahead and done some comparisons between Except and Excerpt/sandbox on a test page, and I can confirm the /sandbox version fixes the issue quite well, bringing my test page from an average of 8s to an average of 6s (The results are being really inconsistent so the improve is probably better than 1/4th). My only concern with doing Transcluder.getTemplates(excerpt) is that, if the excerpt is set to only=files (or similar), the excerpt will include no templates, and therefore wont find any infoboxes, but this is more of a rare scenario. While you could technically grab an unfiltered excerpt of the section and filter out what the user wants later, that also kinda nullifies a significant part of Transcluder's get(), so I'm wary of trying to implement that. Other than that though, this looks like its doing a fine job. Nice work! Aidan9382 (talk) 05:06, 31 May 2022 (UTC)
My theory seems to be correct, but it also seems to not be removing non-free files. Just take a look at the differences from Template:Excerpt/testcases. Also check Template:Excerpt/testcases2 for a weird template difference at the bottom. Note: If the content side by side looks the same, but its marked as different (yellow, uncollapsed), then its a formatting difference. Ignore it, consider it the same. It probably is. Aidan9382 (talk) 13:23, 31 May 2022 (UTC)
@Aidan9382 Thanks for the insights! I was able to fix the issue at the bottom of /testcases2, here. As to the non-free files, as I mentioned to Certes above, it's just a change in the defaults. From here on non-free files will have to be filtered explicitly by setting freefiles=yes. This is because 99% of excerpts don't have issues with non-free files but each check for non-free files is expensive. Finally, regarding the issue in /testcases where only=files no longer gets files from the infobox, I agree this is an edge case not worth the trouble. If no more issues or concerns arise, I'll deploy in a day or two, cheers! Sophivorus (talk) 22:38, 31 May 2022 (UTC)
@Aidan9382 @Certes Deployed! I'll stay around for some minutes just in case, thanks for the awesome work and support! @Find bruce This new version should make setting files=0 unnecessary. Thanks for bringing up this issue in the first place! Sophivorus (talk) 22:07, 1 June 2022 (UTC)

Underscore ref name bug

Agriculture in California is using an excerpt of California wine which produces Cite error: The named reference California wine Misson_Grape was invoked but never defined (see the help page). Examination of the resulting HTML suggests excerpt does not understand _. Invasive Spices (talk) 2 June 2022 (UTC)

Ah, this isn't an issue due to the underscore. This error is because the reference is defined in the infobox (| wine years = {{years ago|1769}}<ref name="Misson_Grape">{{cite web| url=https://www.wine-blog.org/index.php/2011/03/17/the-mission-grape-played-a-major-role-in-california-wine-viticultural-history/ | title=The Mission Grape Played a Major Role in California Wine Viticultural History | author1=Diaz, Jo |website=Wine Blog | date=2011-03-17}}</ref>), and is only a short named reference in the text that was actually excerpted (<ref name="Misson_Grape"/>). For a solution, I'd recommend defining it in the text and keeping it as a short named reference in the infobox. Aidan9382 (talk) 15:57, 2 June 2022 (UTC)
I've implemented the fix, so don't worry about it. Aidan9382 (talk) 16:03, 2 June 2022 (UTC)

Appears to exclude template

Excerpt appears to be excluding {{Election box 2pp}} and I'm not sure why. The template adds a row "Two-party-preferred result" to the election results table - see for example Results of the 2022 Australian federal election in Victoria#Aston which is excerpted to Electoral results for the Division of Aston#2022, where everything but that template. I tried setting templates=.* however that then excerpted only that template & nothing else --Find bruce (talk) 05:05, 4 June 2022 (UTC)

Huh, thats odd. I don't immediately see it in the template blacklist. I'll get looking into it in a short moment. Aidan9382 (talk) 05:08, 4 June 2022 (UTC)
@Find bruce: Thanks for the notice - this seems to be a potential bug with the module. I'll go ahead and look into a fix. For now, just dont worry about getting the 2pp in - I don't see a hacky workaround here. Aidan9382 (talk) 05:23, 4 June 2022 (UTC)

@Sophivorus: (or others) I've implemented a fix for the situation above (It's an issue with how the blacklisting / whitelisting is done and how either its all blacklist or no blacklist, which is a bit inconvenient) that should mean |templates= now correctly overwrites the blacklist. However, I've done this in a way that, in my opinion, might be a bit too off brand, and I'd like input from someone else before submitting an edit request to get this fixed. (This involves a change to both Module:Excerpt/sandbox and Module:Transcluder/sandbox). Opinions? Aidan9382 (talk) 05:59, 4 June 2022 (UTC)

@Aidan9382: We discussed some ideas in #Short description being transcluded above. Certes (talk) 09:35, 4 June 2022 (UTC)
@Certes: Thanks, I missed that. From reading, it seems a decent solution here would be to simply append the "templates" parameter to the default blacklist if it starts with hyphen (-) and replace it if it doesn't. After all, I can't recall of any actual cases where someone wanted to "exclude templates X and Y but include the ones in the blacklist". Do you? It's always "exclude templates X and Y as well as those in the blacklist". I'll try recreate this on the sandbox and see how it functions. If it fixes the idea, I'd be much happier to put that up for an edit request. Aidan9382 (talk) 09:43, 4 June 2022 (UTC)
@Certes: Not only was that super simple to implement, but it seems to have worked fine, and should still follow what Template:Excerpt says for the expected functionallity. If that looks all good to you, I'll put up a TE edit request. Aidan9382 (talk) 09:48, 4 June 2022 (UTC)
@Aidan9382: That looks good to me and even works with the edge case List of United States tornadoes in 1950, but best for Sophivorus to have a quick look at it before it goes live. Certes (talk) 09:57, 4 June 2022 (UTC)
Alright, cool. May I ask, what was the edge case at Tornadoes 1950? Oh and, please reply with direct source - I have no idea whats going on, but Bawl! is freaking out and replacing the previous section with a duplicate (Just see your edit diff in history and itll make sense). Aidan9382 (talk) 10:00, 4 June 2022 (UTC)
Not sure what went on with Bawl there, but thanks for fixing. Tornadoes now uses |templates=.* but had previously used |templates=-Coords to include all templates except Coords (a template not used here, not to be confused with Coord which is used and is included). Certes (talk) 10:09, 4 June 2022 (UTC)
Certes, Aidan9382, a few things happened. When you add a comment, you really do a section edit. Obtain the original text for the section, insert comment into text, perform section edit with new section text. Bawl edited the wrong section: section 20 instead of 21, so the previous section was overwritten with the text of this section plus your comment. This was an odd combination of circumstances. There are several ways to get the right section number: either just take it from the section edit link, search for the section title or.. the other way. When the section number is taken from the section edit link, it'll break if archiverbot passes by while you are reading or if someone adds a subsection in a section above the one you're commenting on. That issue affects all editors. Well, all but Bawl.
Bawl uses the section title when editing a whole section because there isn't much else. (a section could be empty after all) The section #Cite error: Invalid <ref> tag uses nowiki tags in the title. As Bawl can only get the section title from the HTML, any codes can cause issues. To some degree this gets compensated, wikilinks in a title for example are no problem. Nowiki on the other hand.. Using &lt;ref&gt; should work better, but that section can't be edited as a section currently. Should work now too.
But when commenting it actually follows a different strategy. It becomes completely agnostic towards the section title. Section title changed while your were reading? No problem. Bawl determines the section number itself. In this process, various elements are escaped to avoid counting "sections" that are actually code examples or otherwise not actually sections. That ref tag above was an issue as it was seen as an unclosed ref tag. Another issue is found in #Template-protected edit request on 3 March 2022 where within pre tags two opening code tags are found. The second one was meant to be a closing code tag and neither of them work because they are within pre tags. Assuming I won't duplicate this section, I fixed this issue: Bawl now escapes pre and nowiki first as those could legitimately contain unbalanced tags which would otherwise throw off the escape process. Alexis Jazz (talk or ping me) 12:50, 4 June 2022 (UTC)
@Aidan9382 Deployed! Awesome work, thanks! @Alexis Jazz Not sure what this Bawl thing is about, but let me know if you require my input. Cheers! Sophivorus (talk) 13:45, 5 June 2022 (UTC)
@Sophivorus: Dont worry about the Bawl stuff - its something Certes uses in conversation and it had a bit of a bug during our conversation.
Courtesy ping to Find bruce who started this conversation - bug is fixed! Aidan9382 (talk) 14:39, 5 June 2022 (UTC)
Thanks @Aidan9382. Sadly however Electoral results for the Division of Aston#2022 remains broken Find bruce (talk) 21:39, 5 June 2022 (UTC)
@Find bruce: Ah sorry, should've been clear. Theres been no change to the blacklist (I don't even know what from the blacklist is against 2pp, but I have an idea), but it has fixed the |templates= parameter, so you can get around the blacklist should it be a bit odd. I've fixed it as needed. Aidan9382 (talk) 04:56, 6 June 2022 (UTC)

Thanks for clarifying @Aidan9382. The issue affects nearly half of the 2,659 Articles with excerpts, so I'm not keen on running an AWB script to add a workaround. By way of background almost every Australian election result uses 2pp. These results used to be duplicated or triplicated & so to reduce editing effort and inconsistency I have encouraged editors to have the result table at one place and excerpt it to the other articles, eg the 2022 election for Aston is at Results of the 2022 Australian federal election in Victoria#Aston and excerpted at Electoral results for the Division of Aston#2022 and Division of Aston. The module has been so useful & so well accepted that other editors have gratefully adopted using it. I will post a note on the Australian politics project page, which should give enough time to fix the blacklist. Find bruce (talk) 05:27, 6 June 2022 (UTC)

@Find bruce: I see. In that case, I do believe I know what the potential issue is with the blacklist, and I'll do a hopeful edit request now. Hopefully it'll fix, but I'll just need to look at the code for a short moment to confirm my theory. Thanks for the notice! Aidan9382 (talk) 05:30, 6 June 2022 (UTC)

Template-protected edit request on 6 June 2022 - Blacklist fix

Within the blacklist, [Pp]p needs to be changed to ^[Pp]p so that its explicit this should only be matched if at the start. Also note that this means that all the entires with .* in their regex at the end or beginning can have it removed, as it is functionless in this scenario. Aidan9382 (talk) 05:33, 6 June 2022 (UTC)

 Done. P.I. Ellsworth , ed. put'r there 08:09, 6 June 2022 (UTC)
@Find bruce: Core issue fixed. Look all good now? Aidan9382 (talk) 08:14, 6 June 2022 (UTC)
Looks good, thanks for your help @Aidan9382. I really appreciate Sophivorus' work in developing this and the assistance from yourself and Certes in maintaining & improving it - I owe you all a beer if you're in Sydney to collect. Cheers Find bruce (talk) 09:54, 6 June 2022 (UTC)

Template-protected edit request on 11 June 2022 - Blacklist optimisation

Hey. I was recently looking at the section related to -- {{More citations needed}} and its many aliases and noticed quite a lot of the Regexs are repetitive, and that the list could easily be reduced quite far with a few changes. I have posted my changes to the /sandbox, and you can see the difference there.

Couple of important points: There are a lot of specific exclusions to do with reference templates (E.g. '[Ii]mprove[ -]?references?'), but they all get overshadowed by '[Rr]eferences?'. Thats part of the reason so many of the regexs have dissapeared from the list.

If you are confused about a specific removal or optimisation of mine, feel free to ask. It should be functionally equivilant to the previous. It can still be improved much further, but its a bit messy to navigate, and I don't want to go too far and accidentally screw up the blacklist, as this already feels a bit unstable. I have tested this by putting it into the config/sandbox and checking the /testcases, all looks good as far as I can see. Aidan9382 (talk) 19:25, 11 June 2022 (UTC)

@Aidan9382 Deployed! I trust your judgement and the test cases look good. If any unwanted template gets through (or the other way round) we can always fix it on demand. Cheers! Sophivorus (talk) 23:11, 11 June 2022 (UTC)

The fragment parameter does not seem to work

@Sophivorus: see Module:Excerpt/testcases#Fragments

Instead of displaying the specified paragraph of women in philosophy, it displays the entire introductory section

--Yinyue200 (talk) 01:37, 15 June 2022 (UTC)

@Yinyue200 The issue was that "fragment" has become a local alias of the 2nd parameter (see here), so I simply updated the testcases to reflect that (diff). Thanks for the report! Sophivorus (talk) 11:54, 15 June 2022 (UTC)

Further optimisation of the blacklist

Hey! I was recently working on a script to compare and find redundant regexs (see this for the background of it) and I discovered that a lot of regexs in the blacklist are rendered useless by others. The exact list (once manually filtered of false positives, though some may be left in there) looks like this:

List of regexs
[Tt]his article is about is inferior to [Aa]bout
[Tt]his article is about is inferior to [Tt]his
[Cc]ampaignbox is inferior to [Cc]ampaign
[Ll]ocation dec is inferior to [Ll]ocation
[Ff]eatured ?article is inferior to [Ff]eatured
[Ff]eaturedSmall is inferior to [Ff]eatured
FA topicon is inferior to [Tt]opic
[Ll]ead ?missing is inferior to [Ll]ead
[Ll]ede missing is inferior to [Ll]ede
[Nn]ointroduction is inferior to [Nn]o[ -]?[Ii]ntro
[Nn]o[ -]?[Ii]ntro is inferior to [Ii]ntro
[Nn]ointroduction is inferior to [Ii]ntro
[Nn]o ?lead ?section is inferior to [Nn]o[ -]?lead
[Nn]o[ -]?lead is inferior to [Ll]ead
[Nn]o ?lede is inferior to [Ll]ede
[Mm]issingintro is inferior to [Ii]ntro
[Ii]ntro[ -]?missing is inferior to [Ii]ntro
[Nn]o ?lead ?section is inferior to [Ll]ead ?section
[Nn]o ?lead ?section is inferior to [Ll]ead
[Mm]issing lead is inferior to [Ll]ead
[Mm]issing lede is inferior to [Ll]ede
[Ll]ead absent is inferior to [Ll]ead
[Ll]ede absent is inferior to [Ll]ede
[Ii]ntroduction needed is inferior to [Ii]ntro
[Ii]ntroduction missing is inferior to [Ii]ntro
[Ii]ntro needed is inferior to [Ii]ntro
[Ll]ead required is inferior to [Ll]ead
[Ll]ede required is inferior to [Ll]ede
[Ll]ead too long is inferior to [Ll]ead
[Ll]ead too long is inferior to [Ll]ong
[Ll]ead too long is inferior to [Tt]oo[ -]?[Ll]ong
[Ll]ede ?too ?long is inferior to [Ll]ede
[Ll]ede ?too ?long is inferior to [Ll]ong
[Ll]ede ?too ?long is inferior to [Tt]oo[ -]?[Ll]ong
[Ii]ntro ?length is inferior to [Ii]ntro
[Ll]ongintro is inferior to [Ii]ntro
[Ll]ongintro is inferior to [Ll]ong
[Ll]ong ?lead is inferior to [Ll]ead
[Ll]ong ?lead is inferior to [Ll]ong
[Ll]ong ?lede is inferior to [Ll]ede
[Ll]ong ?lede is inferior to [Ll]ong
[Ii]ntro[ -]?too[ -]?long is inferior to [Ii]ntro
[Ii]ntro[ -]?too[ -]?long is inferior to [Ll]ong
[Ii]ntro[ -]?too[ -]?long is inferior to [Tt]oo[ -]?[Ll]ong
[Ll]ead long is inferior to [Ll]ead
[Ll]ead long is inferior to [Ll]ong
[Ll]ead[ -]?rewrite is inferior to [Ll]ead
[Ll]ead ?section is inferior to [Ll]ead
[Vv]agueintro is inferior to [Ii]ntro
[Cc]leanup-lead is inferior to [Ll]ead
[Ii]ntro-?rewrite is inferior to [Ii]ntro
[Ss]hort ?intro is inferior to [Ii]ntro
[Ii]ntro[ -]?too[ -]?short is inferior to [Ii]ntro
[Ii]ntro-expand is inferior to [Ii]ntro
[Rr]ewrite lead is inferior to [Ll]ead
[Cc]leanup lead is inferior to [Ll]ead
[Ll]ead[ -]?too[ -]?short is inferior to [Ll]ead
[Ee]xpand ?lead is inferior to [Ll]ead
[Ss]hort ?lead is inferior to [Ll]ead
[Bb]uild lead is inferior to [Ll]ead
[Ll]ede rewrite is inferior to [Ll]ede
[Ll]ede[ -]?too[ -]?short is inferior to [Ll]ede
[Ee]xpand ?lede is inferior to [Ll]ede
[Mm]ain ?[Aa]rticles? is inferior to [Mm]ain[12]?
[Mm]ain page is inferior to [Mm]ain[12]?
[Ss]ee ?main is inferior to [Mm]ain[12]?
[Rr]eadmain is inferior to [Mm]ain[12]?
[Hh]urricane main is inferior to [Mm]ain[12]?
[Nn]avigation ?[Bb]ox is inferior to [Nn]avigation
[Nn]avigation Template is inferior to [Nn]avigation
[Cc]?VG [Nn]avigation is inferior to [Nn]avigation
[Oo]ther ?[Uu]ses?[13]? is inferior to [Oo]thers?
[Ff]or other uses is inferior to [Oo]ther ?[Uu]ses?[13]?
[Oo]ther ?[Mm]eanings? is inferior to [Oo]thers?
[Oo]thervalues is inferior to [Oo]thers?
[Ff]or other uses is inferior to [Oo]thers?
[Ss]ee other is inferior to [Oo]thers?
[Rr]edirect is inferior to [Rr][Ee]dir
[Ss]ee ?[Aa]lso is inferior to [Aa]lso
[Ss]ee-[Aa]lso is inferior to [Aa]lso
[Ll]ooking for is inferior to [Ll]ooking
[Bb]rief description is inferior to [Dd]escription
[Dd]escription is inferior to [Rr]ip
[Bb]rief description is inferior to [Rr]ip
[Ff]urther2 is inferior to [Ff]urther
[Vv]ery ?long is inferior to [Ll]ong
[Ll]ongish is inferior to [Ll]ong
[Tt]oo[ -]?[Ll]ong is inferior to [Ll]ong
2long is inferior to [Ll]ong
2long is inferior to 2[Ll]
[Cc]ite ?[Ss]ources? is inferior to [Ss]ources?
[Cc]leanup[ -]?[Vv]erify is inferior to [Vv]erify
[Ff]ew ?sources? is inferior to [Ss]ources?
[Ii]mprove[ -]?sources? is inferior to [Ss]ources?
[Mm]ore ?[Ss]ources? is inferior to [Ss]ources?
[Nn]o ?sources is inferior to [Ss]ources?
[Rr]eference improve is inferior to [Rr]eferences?
[Rr]eferenced is inferior to [Rr]eferences?
[Uu]nderreferenced is inferior to [Rr]eferences?
[Uu]nderreferenced is inferior to [Rr]eferenced
[Uu]nsourced is inferior to [Ss]ources?
[Nn]POV is inferior to POV
[Nn]POV Check is inferior to POV
[Nn]POV check is inferior to POV
[Nn]POV-dispute is inferior to POV
[Nn]pov is inferior to [Pp]ov
[Nn]POV check is inferior to [Pp]OV check
[Pp]ov check is inferior to [Pp]ov
[Pp]ov-Check is inferior to [Pp]ov
[Pp]ov-check is inferior to [Pp]ov
[Pp]ovcheck is inferior to [Pp]ov
[Pp]ov Check is inferior to [Pp]ov
[Pp]ov-check-section is inferior to [Pp]ov
[Pp]ov problem is inferior to [Pp]ov
[Nn]POV Check is inferior to [Nn]POV
[Nn]POV check is inferior to [Nn]POV
[Nn]POV-dispute is inferior to [Nn]POV
[Nn]eutrality is inferior to [Nn]eutral
[Pp]OV-check-section is inferior to [Pp]OV-check
[Nn]POV Check is inferior to [Pp]OV Check
[Pp]ov-check-section is inferior to [Pp]ov-check
[Nn]PoV is inferior to [Pp]oV
[Nn]ot neutral is inferior to [Nn]eutral

I'm wondering - is it worth it to correct these? While I wouldn't be surprised if the module ran somewhat faster if these were removed, I do think at least some of these should be potentially kept for the clarity of other editors, though I'm unsure. I would definitely say some of them are much more worrying (E.g. the 4 different version of pov check that could easily be covered by just [Pp]ov[ -][Cc]heck) but some of them are more reasonable. Any comments on this? (If wanted for comparison, I can force the script to give an output of what the cleaned version would look like). Aidan9382 (talk) 22:04, 26 June 2022 (UTC)

@Aidan9382 Awesome work! I do agree that keeping the list human-readable is important. After all, machines should work harder for us, not the other way round heh. That considered, if you want to trim the blacklist based on your work, I'll be happy to deploy it immediately. Sophivorus (talk) 13:49, 27 June 2022 (UTC)

Circumventing loops

Hey! I recently just came across a situation in which an excerpt of a section had an excerpt of its own, leading to the dreaded template loop error. I was wondering - would there be any (reasonable) way to circumvent this? If the excerpt isnt required, just doing templates=-Excerpt does a good job (as I've done here), but I was wondering, what if the nested excerpt was integral? Unfortunately, I don't believe this is an issue that can (or maybe even should) be rectified, however I felt I'd mention it anyways incase someone had a comment or "workaround" on the subject. Aidan9382 (talk) 18:41, 23 June 2022 (UTC)

templates=-Excerpt looks like the way to go. It's a similar situation to Template:Foo calling {{Bar}} whilst Template:Bar calls {{Foo}}, which is avoided only by the loop error check. Certes (talk) 19:10, 23 June 2022 (UTC)
Perhaps Template:Excerpt itself should be added to the blacklist? I don't fancy these double-excerpts since they make things unnecessarily complicated to understand. Sophivorus (talk) 13:54, 27 June 2022 (UTC)

Template-protected edit request on 22 June 2022

Could '[Aa]nchor' be added to the blacklist config? It shouldnt be transcluded on pages by default as, seen above, it can break regular anchors in the text. Aidan9382 (talk) 21:21, 22 June 2022 (UTC)

Done! Sophivorus (talk) 13:55, 27 June 2022 (UTC)

Anchors shouldn't be incorporated

In Agriculture in California something is adding anchors for #Pests and #Diseases before #Cherries. I think this is the preceding {{Excerpt}} incorporating the {{anchor|Pests|Diseases}} in Cannabis in California. I think these are the only anchors it copies to Agriculture in California because there are no other anchors in Cannabis in California merely normal section headers.

This is a more serious problem than it appears because there are identical legitimate section names in Agriculture in California and these sections are the targets of redirects – Pests in California and Agricultural diseases in California. Invasive Spices (talk) 22 June 2022 (UTC)

@Invasive Spices: Hey! Thanks for the report. Looking at this, yeah, I'm not entirely sure why anchors have been included, as they do seem to break the flow of some pages. Ive opened a relevant edit request below that should fix your problem. Hope this helps. Aidan9382 (talk) 21:21, 22 June 2022 (UTC)
@Aidan9382 @Invasive Spices Should be fixed now! Can you confirm? Sophivorus (talk) 13:53, 27 June 2022 (UTC)
Can confirm this has worked. Thanks for implementing it. Aidan9382 (talk) 15:03, 27 June 2022 (UTC)
Confirm. Agricultural pests in California works now and Cannabis in California#Pests has not changed. Thank you for fixing this. Invasive Spices (talk) 27 June 2022 (UTC)

Template-protected edit request on 27 June 2022 - More blacklist changes

More optimisations of the blacklist. Mostly merging / removal of duplicate or similar regexs within the blacklist. Very few minor changes to the actual scopes of the regexs. All changes are visible on the sandbox. My edits have been done in parts so that you may scrutinise specific changes to it if required. Aidan9382 (talk) 20:45, 27 June 2022 (UTC)

 Done. P.I. Ellsworth , ed. put'r there 06:58, 28 June 2022 (UTC)

Possible bug with multi-section editing when excerpting multiple sections

This module is very useful, but I noticed something whenever an editor tries to excerpt multiple sections. Particularly, in MetroCard#Fares is an excerpt of the entirety of New York City transit fares#Current fares. If someone tries to edit one of the excerpted subsections like MetroCard#Fare media, the module will attempt to direct the user to edit the code of Module:Excerpt. I say "attempt" because the user will instead get an error message that section editing is not supported and/or that the user cannot edit the page because they aren't a template editor. This is a minor issue, though, and can probably be resolved by either correcting the edit links for excerpted sections, or by disabling section editing entirely when multiple sections are excerpted. – Epicgenius (talk) 23:40, 3 July 2022 (UTC)

Misnested tag lint error with file=yes

James Lovelock showed up in Lint errors: Misnested tag with different rendering in HTML5 and HTML4 (article namespace). The cause turned out to be

{{Excerpt|Gaia hypothesis|only=file|inline=yes}}

which has 2 pairs of HTML5-misnested and missing end tags for <span>...</span>. I tried

{{Excerpt|Gaia hypothesis|only=file|inline=no}}

which fixed the lint errors, but added unwanted display. So I went to What links to Template:Excerpt and edited each such page, one after the other, until I found one with

{{Excerpt|...|only=file...}}

or

{{Excerpt|...|only=files...}}

and the first one turned out to be Coal, which includes

{{Excerpt|Coal Pollution Mitigation|only=files|hat=no}}

which turns out not to have lint errors. So I tried

{{Excerpt|Gaia hypothesis|only=file|hat=no}}

and that seemed to give the same display as before (but without lint errors) and, for what it's worth,

{{Excerpt|Coal Pollution Mitigation|only=files|inline=no}}

does have the 2 pairs of lint errors.

If the template is working correctly, the documentation needs to explain what combinations of parameters to use or not use. More likely, the template needs to be modified so that {{Excerpt|...|only=file|inline=no}} and {{Excerpt|...|only=files|inline=no}} work, without generating lint errors. —Anomalocaris (talk) 06:46, 2 August 2022 (UTC)

Note to other editors: This issue seems to be originating from Lines 227/228. When inline is specified, the div tags used for the excerpt and excerpt-block classes are exchanged for span tags, and causes this mis-nesting. Unfortunately, I'm not familiar enough with HTML5/4 to know what a suitable fix is for this, so I shall leave this to another editor. Aidan9382 (talk) 09:40, 5 August 2022 (UTC)
@Anomalocaris @Aidan9382 Fixed, thanks for the report and research. It seems the problem was that block elements such as files cannot be nested inside inline elements such as spans, so I changed the spans for divs with display:inline set via CSS. Kind of hacky but does the job. I also changed inline=yes for hat=no in James Lovelock though. It seemed a more appropriate use of the parameters. Cheers! Sophivorus (talk) 12:53, 5 August 2022 (UTC)
Sophivorus: Thank you very much! —Anomalocaris (talk) 17:19, 5 August 2022 (UTC)
TPER disabled upon completion. P.I. Ellsworth , ed. put'r there 20:28, 5 August 2022 (UTC)