Last modified: 2014-11-17 10:34:46 UTC
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.
Would adding <references/> to [[MediaWiki:Edittools]] accomplish the same thing?
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.
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.
There now is a simple JavaScript that handles "the problem" quite well. Script: * http://de.wikipedia.org/wiki/Benutzer:ParaDox/VirtualReferences.js Diskussion: * http://de.wikipedia.org/wiki/Benutzer_Diskussion:ParaDox/VirtualReferences.js Feature-Request: * http://de.wikipedia.org/w/index.php?title=Wikipedia:Verbesserungsvorschl%C3%A4ge/Feature-Requests&oldid=43602880#Virtuelles_.E2.80.9Ereferences.E2.80.9C-Tag_f.C3.BCr_.E2.80.9EVorschau_zeigen.E2.80.9C
*** Bug 5492 has been marked as a duplicate of this bug. ***
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?
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?
*** Bug 24681 has been marked as a duplicate of this bug. ***
(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".
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)
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.
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.
(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: # 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; # 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.
(In reply to comment #13) > # 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.
*** Bug 28849 has been marked as a duplicate of this bug. ***
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).
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."
This was brought up again at [[Wikipedia:Village_pump_(proposals)#Auto_reflist_when_previewing_whilst_section_editing]], FWIW.
(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.)
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.
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).
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
Change 129932 abandoned by Legoktm: Add reference list to section preview if missing https://gerrit.wikimedia.org/r/129932
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.
Since the patch is abandoned, I am changing the status to NEW.