https://bugzilla.wikimedia.org/show_bug.cgi?id=46349

       Web browser: ---
            Bug ID: 46349
           Summary: Reference list produces errors if ParserClearState
                    fires after <ref> tags, but before <references>
           Product: MediaWiki extensions
           Version: master
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: Unprioritized
         Component: Cite
          Assignee: [email protected]
          Reporter: [email protected]
    Classification: Unclassified
   Mobile Platform: ---

Created attachment 11960
  --> https://bugzilla.wikimedia.org/attachment.cgi?id=11960&action=edit
Git patch; adds a $mDoneReferences boolean to determine if <references> has
been parsed,

I have tested and found this bug is present in master and REL1_20.

If ParserClearState fires after <ref> tags have been parsed, but before the
<references> tag has been parsed, Cite resets the stack and thus when rendering
<references> will either fail to display references or will output the "<ref>
tag with name [] defined in <references> is not used in prior text" error.

I have a use case of this. I haven't identified *why* ParserClearState is being
fired.

I'm attaching a patch which solves this by adding a boolean which is set after
the references tag has been processed, ensuring that Cite doesn't reset until
*after* <references> has been rendered.

Since I don't entirely understand the design decision to reset on
ParserClearState, I'm not sure if this will have unintended consequences and
would appreciate some advice.

If it looks good, I'll submit a change on gerrit.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to