Edit preview doesn't let you preview cite.php footnotes.
OpenPublic

Assigned To
None
Priority
Low
Author
bzimport
Blocked By
T8812: Requesting hook to affect preview text
Subscribers
MusikAnimal, Gadget850, Theopolisme and 9 others
Projects
Tokens
"Like" token, awarded by He7d3r.
Reference
bz5984
Description

Author: contactbox

Description:
At present, if a section or article being edited does not contain the <
references /> tag, then footnotes will not show up in page preview. This
means you have to commit the edit, then examine the new saved page and re-
edit instead.

Enhancement request -- if the page being rendered for preview contains cite.
php footnotes, AND there is no <references /> tag in the previewed text that
will cause footnotes to be displayed, then the preview code adds a
horizontal line followed by <references /> after the existing text, so that
users can see their proposed footnotes too.


Version: unspecified
Severity: enhancement

bzimport added a project: Cite.Via ConduitNov 21 2014, 9:14 PM
bzimport added a subscriber: wikibugs-l.
bzimport set Reference to bz5984.
bzimport created this task.Via LegacyMay 16 2006, 3:22 PM
bzimport added a comment.Via ConduitMay 18 2006, 10:12 PM

titoxd.wikimedia wrote:

Would adding <references/> to [[MediaWiki:Edittools]] accomplish the same thing?

bzimport added a comment.Via ConduitMay 18 2006, 11:36 PM

contactbox wrote:

If the text to be rendered in preview is the whole
article, or certain sections, it might contain the
</references> tag already, in which case you don't
want to render it twice. So you have to check and
only add it if it won't be rendered as-is.

Example pathological cases to check for:

<nowiki><references /></nowiki>
<references /> tag included in a template
<ref> ... </ref> or <ref /> in a template

etc.

So you have to check in coding it, whether the
text as-is includes any renderable cite.php refs,
and whether in preview, the text will include a
rendered <references /> section if so.

bzimport added a comment.Via ConduitMay 18 2006, 11:49 PM

contactbox wrote:

Afterthought...

I don't mean you have to "trial render". Rather I
mean, you have to have a way to flag during
rendering, whether a <ref> was rendered and
whether a <references /> was rendered. Possibly an
elegant solution might be that the call to the
render engine has a parameter "
AutoAddReferencesSection", set to TRUE for preview
and FALSE elsewhere, that adds a terminal <
references> section if it is needed, before
returning the rendered text.

But as Im not a coder, that may be a very naive
approach. I don't know how helpful that is.

MZMcBride added a comment.Via ConduitOct 20 2008, 7:56 AM
  • Bug 5492 has been marked as a duplicate of this bug. ***
bzimport added a comment.Via ConduitAug 3 2009, 4:34 PM

rene.kijewski wrote:

I don't think using JavaScript is a proper solution.
Maybe it would be possible to give a preview in the “Templates used in this section”-section?

bzimport added a comment.Via ConduitAug 3 2009, 4:40 PM

svippy wrote:

JavaScript certainly do not seem like a solution to this.

Though, personally, I do not consider this a problem. While editing, you might just add the <references/> tag at the bottom of the section, then preview it, see if those cites are all right, and move on.

You may obviously run into problems when you are reusing cites from earlier (or later) in the article, which are not declared in this section and thus <references/> will not know what to do, except tell you that it does not exist.

This sounds like a revisit of the entire article for this purpose to fulfil itself, which sort of renders the whole feat of using section editing fruitless. I would call this a simple issue you that should just work around. There seems to be no perfect solution. Also, isn't this an issue with the Cite extension rather than with MediaWiki itself?

demon added a comment.Via ConduitAug 6 2010, 12:17 PM
  • Bug 24681 has been marked as a duplicate of this bug. ***
bzimport added a comment.Via ConduitAug 7 2010, 6:45 PM

RSYQFIOJGWZA wrote:

(In reply to comment #7)

Also, isn't this an issue with the Cite extension rather than with MediaWiki itself?

The "Component" is currently set to "Cite".

bzimport added a comment.Via ConduitAug 13 2010, 3:37 AM

RSYQFIOJGWZA wrote:

There are two more javascript solutions mentioned at http://en.wikipedia.org/wiki/MediaWiki_talk:Edittools#References as follows (with absolute URLs):
The userscript at user:js/ajaxPreview http://en.wikipedia.org/wiki/User:Js/ajaxPreview provides a <references /> preview when editing sections. Possibly the code there, or someone at its talkpage, could help here? HTH. -- Quiddity (talk) 21:16, 9 August 2010 (UTC)
If you really care about references, user:Anomie/ajaxpreview.js http://en.wikipedia.org/wiki/User:Anomie/ajaxpreview.js does much more, it even checks for named references from other sections. Of course, JavaScript solutions have nothing to do with Edittols. — AlexSm 22:03, 9 August 2010 (UTC)

bzimport added a comment.Via ConduitJan 7 2011, 2:15 PM

gfitzger wrote:

Seems to me a fairly simple way to solve this would be to include a "Preview Full Article" link, either for all previews or just section-edit previews.

bzimport added a comment.Via ConduitJan 7 2011, 5:03 PM

ayg wrote:

Adding extra links is a bad solution to practically any problem. It would be better to just output the references automatically in section edits if there otherwise aren't any.

bzimport added a comment.Via ConduitFeb 12 2011, 6:36 PM

RSYQFIOJGWZA wrote:

(In reply to comment #12)

It would be
better to just output the references automatically in section edits if there
otherwise aren't any.

Yes, it would. Better still would be to:

  1. not limit that automatic output to section edits, but instead automatically *output* a references section (if there are ref tags but no references section) for the whole page or section (while displaying an existing page or section, to cover up the problem with existing pages) - we already have detection logic for this in the parser;
  2. and automatically *add* a references section (if there are ref tags but no references section) for the whole page to the wikitext (while editing, to fix the problem with existing pages).

An ambitious bot, set of bots, or database correction could automatically *add* a references section (if there are ref tags but no references section) for the whole page to the wikitext for every page in every project of every organization that uses this extension to fix the problem with existing pages, given approval by the developers of those projects.

Svick added a comment.Via ConduitFeb 12 2011, 9:21 PM

(In reply to comment #13)

  1. and automatically *add* a references section (if there are ref tags but no references section) for the whole page to the wikitext (while editing, to fix the problem with existing pages).

How exactly would that be done? What name would that section have? Where would that section go? What about references with group parameter?

On enwiki, {{references}} is usually used instead of <references />, the section name is either “Notes” or “References” and the section goes before the External links section.

I don't think logic should be implemented in MediaWiki, especially since consensus about those things can change and other wikis have other customs. And according to the text at [[Category:Pages with missing references list]], AWB already fixes this and at least enwiki has a bot that fixes those errors.

brion added a comment.Via ConduitMay 6 2011, 9:16 PM
  • Bug 28849 has been marked as a duplicate of this bug. ***
bzimport added a comment.Via ConduitDec 22 2011, 3:31 AM

fredgandt wrote:

Comment in general support for this functionality. For reference (no pun intended), a discussion/proposal on en:WP is here --> [[Wikipedia:Village_pump_(proposals)#Reflist_should_be_shown_when_previewing_a_section_edit]] (first comment for me on Bugzilla and no preview, please excuse if messy).

bzimport added a comment.Via ConduitDec 15 2012, 10:16 PM

s.vanslyck wrote:

When editing a section the footnote text never appears, at least not if the {{references}} or <references /> is not within that section. Suggest this bug be restated as

"Enhancement request -- If the page OR SECTION being rendered for preview contains cite or php footnotes, then the preview code should add a
horizontal line followed by <references /> after the existing text, so that
users can see their proposed footnotes and examine potential errors without having to commit the edit."

Theopolisme added a comment.Via ConduitApr 13 2013, 1:16 AM

This was brought up again at [[Wikipedia:Village_pump_(proposals)#Auto_reflist_when_previewing_whilst_section_editing]], FWIW.

SamB added a comment.Via ConduitFeb 15 2014, 6:11 PM

(In reply to Steve from comment #17)

When editing a section the footnote text never appears, at least not if the
{{references}} or <references /> is not within that section. Suggest this
bug be restated as

"Enhancement request -- If the page OR SECTION being rendered for preview
contains cite or php footnotes, then the preview code should add a
horizontal line followed by <references /> after the existing text, so that
users can see their proposed footnotes and examine potential errors without
having to commit the edit."

I think it would probably sound better if you drop the "page" part.

Also, I don't think you can modify the Description in Bugzilla, only the Summary, so you'd need something much snappier, like "Section edit preview doesn't show cite.php footnotes". (https://bugzilla.wikimedia.org/docs/en/html/bug_page.html doesn't even mention the *existence* of the Description.)

SamB added a comment.Via ConduitFeb 15 2014, 7:18 PM

Also, note that I find this quite annoying, too, and I'd be perfectly content if only the refs actually present in the section are actually included. If it's not in the section I'm editing, I can't possibly screw the reference itself up; the worst that could happen is that I do <ref name=... /> with the wrong name.

Technical13 added a comment.Via ConduitMar 1 2014, 9:02 PM

Can't a collapsed by default section at the bottom of an edit page be added that shows all of the references for the section being edited? https://en.wikipedia.org/wiki/Wikipedia:Village_pump_%28idea_lab%29#Section_editing_reflinks_idea is why I'm bumping this thread. I would think that if whole page references are really wanted, that could also be accomplished as well, and I can think of a detailed output method that I think would work great (although I could see others as disagreeing with me).

gerritbot added a comment.Via ConduitApr 27 2014, 1:48 AM

Change 129932 had a related patch set uploaded by Gerrit Patch Uploader:
Add reference list to section preview if missing

https://gerrit.wikimedia.org/r/129932

gerritbot added a comment.Via ConduitJul 3 2014, 7:33 PM

Change 129932 abandoned by Legoktm:
Add reference list to section preview if missing

https://gerrit.wikimedia.org/r/129932

bzimport added a comment.Via ConduitJul 8 2014, 2:42 PM

wp.makyen wrote:

The abandonment of https://gerrit.wikimedia.org/r/129932 without explanation implies that the fix for https://bugzilla.wikimedia.org/show_bug.cgi?id=66860 solves this issue. Based on testing, the fix for that bug does not show references in section previews.

I can understand that [https://gerrit.wikimedia.org/r/129932 129932] might be incompatible with [https://gerrit.wikimedia.org/r/#/c/141583/ 141583]. However, if that is the reason for abandonment, then please say so. It is also unclear to me that abandonment would be the appropriate course of action if the issue was incompatibility with [https://gerrit.wikimedia.org/r/#/c/141583/ 141583]. In my opinion, the more appropriate course of action would have been to indicate the incompatibility and make additional updates to [https://gerrit.wikimedia.org/r/129932 129932].

Because of the lack of explanation, I am just guessing here as to the reason for the request to abandon those changes. However, at least to me the request implies that [https://gerrit.wikimedia.org/r/129932 129932] is being abandoned because [https://gerrit.wikimedia.org/r/#/c/141583/ 141583] fixes this issue when it does not.

Gadget850 added a comment.Via ConduitSep 25 2014, 5:51 PM

Since the patch is abandoned, I am changing the status to NEW.

He7d3r awarded a token.Via WebNov 24 2014, 12:03 PM
MusikAnimal added a subscriber: MusikAnimal.Via WebWed, Feb 18, 8:36 PM

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.