Module talk:Excerpt
| Module:Excerpt is indefinitely protected from editing as it is a heavily used or highly visible module. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify an administrator or template editor to make the requested edit.
|
| This is the talk page for discussing improvements to the Excerpt module. |
|
| Archives: 1, 2, 3, 4Auto-archiving period: 5 months |
| This module does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||||||
| |||||||||||
| To help centralize discussions and keep related topics together, the talk pages for all the transclude excerpt templates redirect here (as of 15 May 2020 UTC): |
Font bug on Apple Safari
From phab:T413341 by Jengod.
Steps to replicate the issue (include links if applicable):
- use
{{excerpt|Page#Section}}
Example: https://en.wikipedia.org/wiki/Food_of_The_Bear_(TV_series)#Friends_&_Family_Night?useformat=mobile
What happens?:
When viewed on mobile on Safari the last paragraph of the text renders in like 10-pt instead 12-pt
What should have happened instead?:
12-pt version
Screenshots:
Mobile - https://phabricator.wikimedia.org/F71188822
Desktop - https://phabricator.wikimedia.org/F71188823
This article happens to use excerpt template a lot but I've seen this bug before on pages where it's just a one-off * Pppery * it has begun... 16:58, 23 December 2025 (UTC)
- From TheDJ: "Confirmed. The last paragraph is not wrapped in paragraph markup, but should be." * Pppery * it has begun... 16:58, 23 December 2025 (UTC)
- Strangely, this bug seems to happen only in article space, which is concerning because the only difference is the addition of a category towards the end, which definitely shouldn't be removing paragraph markers somehow. I'll see if I can work down to a more refined test case Aidan9382 (talk) 17:15, 23 December 2025 (UTC)
- This seems to be some strange behaviour from the parser to do with text being on the same line as a div. Check the raw html vs the wikitext of this test page (the specific case of this that excerpt is running into is the third case with the category). My main question is, is this excerpt's fault, or is the parser doing weird stuff it shouldn't here? Regardless, I've fixed this in the module by making sure the padding newlines don't get lost when tracking categories get added, which solves the issue. Aidan9382 (talk) 17:30, 23 December 2025 (UTC)
- @Aidan9382 @Pppery just found this resolution by following the breadcrumb trail. Thank you guys so much for fussing with this. I don't understand your magic at all but I do appreciate you!! jengod (talk) 22:04, 20 January 2026 (UTC)
- This seems to be some strange behaviour from the parser to do with text being on the same line as a div. Check the raw html vs the wikitext of this test page (the specific case of this that excerpt is running into is the third case with the category). My main question is, is this excerpt's fault, or is the parser doing weird stuff it shouldn't here? Regardless, I've fixed this in the module by making sure the padding newlines don't get lost when tracking categories get added, which solves the issue. Aidan9382 (talk) 17:30, 23 December 2025 (UTC)
- Strangely, this bug seems to happen only in article space, which is concerning because the only difference is the addition of a category towards the end, which definitely shouldn't be removing paragraph markers somehow. I'll see if I can work down to a more refined test case Aidan9382 (talk) 17:15, 23 December 2025 (UTC)
Failure with Template:Multiple image in infobox
See User:PrimeHunter/Excerpt test where the excerpt output includes [[File:
|thumb|]]. I think it would be OK to not display an infobox image if it uses {{Multiple image }} but it's bad to display broken code. I saw the issue at Wikipedia:Village pump (technical)#Error with excerpt in the United States-Venezuela relations article. PrimeHunter (talk) 16:41, 5 January 2026 (UTC)
- It's not that it's generating an empty [[File:]] wikilink, but that it's putting the entire multiple image template's text as the target page for the file link, which unsurprisingly ends poorly. The /portals version handles it fine, so perhaps there's something to take from there, though gotta make sure it doesn't break some other case. Aidan9382 (talk) 17:22, 5 January 2026 (UTC)
- The original example was
{{Excerpt|2026 United States strikes in Venezuela}}. Special:ExpandTemplates says the only content of the attempted file link was:
- The original example was
[[File:1 |thumb|]]
- I get that it can be hard to extract something meaningful but maybe it should test whether the extracted file name exists and omit the file link otherwise. PrimeHunter (talk) 18:36, 5 January 2026 (UTC)
2025–2026 Iranian protests: the lead first paragraph is the 11th paragraph
With the 16:27, 10 January 2026 version of 2025–2026 Iranian protests, {{excerpt|2025–2026 Iranian protests|only=paragraphs|paragraph=11}}, i.e. selecting only the 11th paragraph, is needed to get the brief paragraph Beginning on 28 December 2025, mass demonstrations ... 1979 Islamic Revolution.[refs]
This seems to be a problem with the infobox, based on non-systematically trying some among the 1st to 10th "paragraphs".
In this particular case, with a high-attention article as the source article, it would be unwise to hardwire this to paragraph 11, since infobox evolution is likely to happen, making the excerpts bounce on and off between valid and invalid excerpts and arbitrary i-th paragraphs of the actual lead. Any ideas for a solution that would work now would be welcome (I'm starting a discussion at Template talk:2025–2026 Iranian protests).
This case is likely useful to add to test cases. Boud (talk) 16:38, 10 January 2026 (UTC)
- I looked into this issue and it seems that the cause was that the 16:27, 10 January 2026 version had several wikitext syntax errors, as can be seen by editing the page (with the source editor) and enabling the syntax highlight tool. As those errors were resolved, the paragraph excerpt fixed itself. Sophivorus (talk) 14:29, 12 January 2026 (UTC)
Template:r in source causes cite error when transcluding
List of immigration raids and arrests in the second Trump presidency (Diff ~1318810311) introduced this error:Cite error: The named reference descend was invoked but never defined
This error existed for nearly 3 months until I just fixed it by getting rid of {{r}}: MacArthur Park (Diff ~1334397423). — Alexis Jazz (talk or ping me) 08:32, 23 January 2026 (UTC)
Error with excerpt template
On the page Guadalupe River an excerpt from the page July 2025 Central Texas floods is showing formatting for an image thumbnail link in addition to the images (multiple image template). Is it possible to remove the formatting? Thank you @ColinFine for redirecting this post! Tsarivan613 (talk) 19:27, 11 February 2026 (UTC)
Courtesy link: Guadalupe River (Texas) ColinFine (talk) 19:33, 11 February 2026 (UTC)
- I suggested to Tsarivan613 that the problem might be with the templates that are by default excluded from {{Excerpt}}, but I didn't understand what was going on. The material that is not being interpreted is in a {{multiple image}} call. --ColinFine (talk) 20:16, 11 February 2026 (UTC)
- I have added
|files=0to omit transclusion of files.[1] PrimeHunter (talk) 20:19, 11 February 2026 (UTC)
- I have added
Feature request for file excerpts
It would be nice to use this module to transclude the top image of an article into a table (for example, List of crossings of the Ohio River). Using {{Excerpt|<article>|paragraph=0|file=1|hat=no}} almost does this, but it only renders the image in thumbnail format when it needs to be in basic format. It would be nice to have an option to retrieve the filename only rather than the thumbnail markup, to give flexibility in its layout. Thanks! Antony–22 (talk⁄contribs) 01:50, 5 March 2026 (UTC)
- @Antony-22 That seems very useful and doable. I'll try to implement it later today or tomorrow, cheers! Sophivorus (talk) 11:20, 5 March 2026 (UTC)
- Thanks for the quick turnaround! It would be great for it to return a blank image like File:Noimage.png if there are no images in the target page, to avoid causing markup errors. Antony–22 (talk⁄contribs) 21:26, 5 March 2026 (UTC)
Done Try it out with the following syntax: {{Excerpt|Aristotle|only=filename}}and let me know how it goes. I also implemented the suggested feature that if no image is found, then "Noimage.png" will be returned. Kind regards, Sophivorus (talk) 13:08, 6 March 2026 (UTC)
- Thanks for the quick turnaround! It would be great for it to return a blank image like File:Noimage.png if there are no images in the target page, to avoid causing markup errors. Antony–22 (talk⁄contribs) 21:26, 5 March 2026 (UTC)

@Sophivorus: It seems to work most of the time. But inside a table it causes the file markup to not be recognized (example). Any ideas on how to fix that? Antony–22 (talk⁄contribs) 05:00, 26 March 2026 (UTC)
- Hm, the problem seems to be when the file is in an infobox. I looked at the code but I can't think of an easy fix right now... Sophivorus (talk) 12:07, 26 March 2026 (UTC)
- @Sophivorus:. Okay, it's weirder. In fact, it doesn't work at all in article space, even outside a table or infobox. It works within Visual Editor but not when you save it. It also works when I copy-paste the whole article into my sandbox. Could be an obscure parser issue? Antony–22 (talk⁄contribs) 18:34, 31 March 2026 (UTC)
Template-protected edit request on 7 March 2026
This edit request to Template:Excerpt has been answered. Set the |answered= parameter to no to reactivate your request. |
When the Intro-excerpt is used in an article, that section may well include additional content. So please modify the wording for the hatnote from:
"This section is an excerpt from..." to "This section includes an excerpt from...". Thank you. Anomalous+0 (talk) 04:32, 7 March 2026 (UTC)
Not done: it's not clear what changes you want made. Please detail the specific changes in a "change X to Y" format and provide a reliable source if appropriate. Zackmann (Talk to me/What I been doing) 05:20, 8 March 2026 (UTC)
Notification of creation of new excerpt template
Not sure who needs to see this, but just leaving a notification that I created a template that lets you increase/decrease excerpt levels while excerpting. Alexandraaaacs1989 (talk) 16:58, 11 March 2026 (UTC)
- Alexandraaaacs1989, possible duplication or overlap with Template:Conditional heading, although I haven't looked in detail at your new template. Mathglot (talk) 21:43, 15 March 2026 (UTC)
- Thanks for pointing that out! I took a look and my template has some duplicate functionality, but it also has some features not implemented in the other template. Not sure if I have the bandwidth to combine the two, I mainly just needed the template I made for an article I'm working on. But maybe I can get around to merging them soon. Alexandraaaacs1989 (talk) 00:24, 16 March 2026 (UTC)
- @Alexandraaaacs1989 Nice work! I think this functionality could eventually be added to Module:Excerpt too. Cheers! Sophivorus (talk) 12:16, 16 March 2026 (UTC)
Copying the ref tag content verbatim?
As far as I can tell if the excerpt contains <ref name=Foo/>, the resulting text will include the citation from the excerpted page. The only alternative is no citations at all. I guess there is no option to pass through the markup and let the citation be satisfied by content in the receiving page? Johnjbarton (talk) 01:04, 23 March 2026 (UTC)
- Hi! There currently is no option to do that. Perhaps Help:Labeled section transclusion can work for you. That being said, if I understand your intention correctly, I would advise against doing that, because it might be very confusing for future editors. Kind regards, Sophivorus (talk) 12:50, 23 March 2026 (UTC)
2018–2024 Arab protests
There's a bug in the excerpt of 2018–2024 Arab protests displayed at Arab Spring § Second Arab Spring (Arab Summer). Daask (talk) 21:49, 3 April 2026 (UTC)
- @Daask Thanks for the report! The bug is caused by the fact that Template:Multiple image is used within the infobox of 2018–2024 Arab protests. It's not easy to fix, so I "solved" it by omitting images from the excerpt altogether (see this diff). Kind regards, Sophivorus (talk) 12:33, 4 April 2026 (UTC)
Unwanted line break
At Artemis_program#Artemis_Accords, using an excerpt produces an extra line break. I'm not sure where it's coming from; could this be fixed? Sdkb talk 05:10, 6 April 2026 (UTC)
- Unexpectedly, the issue was caused by this extra whitespace. I can't think of a good fix from the module right now, so in the meantime I removed the extra whitespace from the article instead. Thanks for the report! Sophivorus (talk) 13:52, 7 April 2026 (UTC)
Excerpt feed
Is there anyway to turn off these excerpt templates from displaying the templates on their full articles? For example on the Economy of Canada's section on its automotive sector, the excerpt is displaying all the templates on Automotive industry in Canada. Any way to toggle that off? This issue is prevalent on many articles. Peripteros (talk) 07:55, 15 April 2026 (UTC)
- You can use the
|templates=parameter on a per-use basis (more info at Template:Excerpt § Details) if needed, however to answer your specific case, sidebars like this are normally on a hide-by-default basis, but it just so happens that "Economy of" wasn't a checked-for name. I've added it here, which now hides the specific sidebar template you were talking about by default so you don't have to manually exclude it. Aidan9382 (talk) 10:21, 15 April 2026 (UTC)
Bolded, unlinked word in source turns into linked, unbolded term
Something odd going on here, excerpting a paragraph from Template:Uw-coi:
{{Excerpt |Template:Uw-coi |only=paragraphs|lists=1 |paragraphs=2 |hat=no |inline=yes}}⟶- In addition, you are required by the Wikimedia Foundation's terms of use to disclose your employer, client, and affiliation for any contribution which forms all or part of work for which you receive compensation. See Wikipedia:Paid-contribution disclosure.
The bolded, unlinked word '''required''' in the source, turns into the unbolded word linked to the template source. Mathglot (talk) 17:32, 30 May 2026 (UTC)
- Here's another clue, perhaps. These two cases do the same thing in adding linkage to a bolded term, but only to the first item in a list that has bolded text in the source, not to the other ones:
{{Excerpt |Template:Uw-coi |only=lists |lists=1 |hat=no}} |
|---|
|
{{Excerpt |Template:Uw-coi |only=lists |lists=1 |hat=no |bold=yes}} |
|---|
|
- Note that in the both examples, the first bullet has linkage added which was not there in the original. The second example shows the original bolding, and retains the anomalous, added link, but only in bullet #1. Mathglot (talk) 18:09, 30 May 2026 (UTC)
- The Excerpt template tries to link to the page being excerpted, as this is normally useful. It relies on our convention that, when an article first mentions its own subject, it does not link to itself but uses bold text. Excerpt tries to replace the first such mention by a wikilink. In
{{Excerpt|Meatloaf}}, - The link need not be the first bold text. In
{{Excerpt|Meat Loaf}},Michael Lee Aday... known professionally as Meat Loaf...
gets replaced byMichael Lee Aday... known professionally as Meat Loaf...
- When the title does not appear in bold, but other early text does, Excerpt guesses that the first bold text is a synonym for the title. In
{{Excerpt|Alisha (singer)}},Alisha Ann Itkin... is an American freestyle and dance-pop singer...
gets replaced byAlisha Ann Itkin... is an American freestyle and dance-pop singer...
(with a piped link in case there was no redirect)
- Excerpt wasn't designed for inserting a template (usually we just transclude) and the guess seems inappropriate here. Certes (talk) 18:31, 30 May 2026 (UTC)
- Okay, that explanation makes sense. I can undo the linkage with a {{replace}}, so no worries. I just wondered if there was something unintended going on here, but if not, then we're good. Thanks, Mathglot (talk) 18:37, 30 May 2026 (UTC)
- Thinking further: I wonder if linking the first bold item that matches the title could be kept for main and draft space, suppressed for the others. Haven't thought this through yet, probably have to think further one by one, to see if it makes sense for every namespace but those. Just an idea. Mathglot (talk) 18:42, 30 May 2026 (UTC)
- I think it makes sense. Generally, we only use the
A title is a...
opening in those namespaces. Maybe include Wikipedia: namespace e.g.Protection restricts the modification of pages...
in WP:PROTECT, but that feature might never get used or might do more harm than good. Certes (talk) 19:43, 30 May 2026 (UTC)- If we decide to go with it, in theory it could be a breaking change for any existing use of Excerpt that excerpts other namespaces that have bolding. We could have a param
|boldtitle=yesto override. (The longish param name is on analogy with MOS:BOLDTITLE, but we could find a shorter alternative.) - Another thing that occurs to me is that outside of {{excerpt}}, when we bold a title, it is almost always in the first paragraph (usually the first sentence) if bolded at all, and invariably in paragraph context. I can't think of a case where it might be in a table, link, list item, reference, or anything else. So we could add some robustness with something like:
- if paragraph-context and paragraph-number = 1 and (arg-boldtitle missing or not=yes) then bold first occurrence
- As far as the extent of possibly breaking changes, in template space, there are 78 templates that directly use Excerpt. Wikipedia project space=311; Draft: 19; Help: 1; Module: 0; Event: 2; Portal: 47; Category: 12. But I suspect very few of these would involve a bolded term in the source matching the target page title. We could spot-check a subset, to get a feeling for it. Count me in if you want to assign me a couple dozen to examine. Mathglot (talk) 20:34, 30 May 2026 (UTC)
- I don't think we're losing much (if anything) by restricting the linking to excerpts from mainspace. By default, Excerpt prepends This section is an excerpt from [link to page], so there's a link anyway. We should check the namespace of the donor page rather than the recipient. For example, a portal showing an excerpt from a mainspace article (which was this template's original purpose) should still add the link. We don't currently excerpt from Draft:, and probably never should. Certes (talk) 22:21, 30 May 2026 (UTC)
- If we decide to go with it, in theory it could be a breaking change for any existing use of Excerpt that excerpts other namespaces that have bolding. We could have a param
- I think it makes sense. Generally, we only use the
Edit request 2 June 2026
This edit request to Module:Excerpt/config has been answered. Set the |answered= parameter to no to reactivate your request. |
Description of suggested change: The config doesn't exclude the template {{Italic disambiguation}}, which can cause errors or unintended changes to the articles this template is used in. (Example: [2]) It is likely also reasonable to exclude {{Italic dab}} as it redirects to {{Italic disambiguation}}. This is required because {{Italic disambiguation}} calls {{#invoke:Italic title|dabonly}} directly instead of using the template {{Italic title}}.
Diff:
| − | '[Dd]isplay ?title', 'DISPLAYTITLE', '[Ii]talic title', | + | '[Dd]isplay ?title', 'DISPLAYTITLE', '[Ii]talic title', '[Ii]talic disambiguation', '[Ii]talic dab', |
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.
