Page MenuHomePhabricator

Cite allows block content inside a span
Closed, DuplicatePublic


rECIT53ae80785a27 added a span around the reference text, but references can contain block content (such as div, p), which is not allowed inside a span, and Tidy rightfully moves the content outside of the main "references-text" span (and mangles everything, as usual), breaking anything relying on the reference text being inside that span (such as reference scripts).

This can be easily fixed by changing it to a div, and applying a display:inline styling to it.

Alternatively, if you only want to support inline content in references, cite should strip out block content instead of outputting broken HTML.

Event Timeline

Majr created this task.Mar 3 2016, 10:55 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 3 2016, 10:55 AM
Devirk added a subscriber: Devirk.Mar 6 2016, 7:09 PM
Aashaka added a subscriber: Aashaka.EditedMar 9 2016, 12:56 PM

I would like to work on this bug. I have changed span to div where required and applied display:inline styling to div.reference-text in ext.cite.styles.css.
I also made suitable changes in citeParserTests.txt. But I got confused by the presence of this file, as I didn't see any tests for Cite extension. Are there tests for this extension which I am not able find?

@Aashaka: Thanks for working on this! Have you checked the file citeParserTests.txt in the Cite repository? I cannot find anything else either...
And linking to your patch in Gerrit is very welcome. :)

Change 276183 had a related patch set uploaded (by Aashaka):
Use div element instead of span around reference text

TheDJ added a subscriber: TheDJ.Mar 17 2016, 1:47 PM

Do we have an idea how big of a problem this is ?

I am not sure, but I guess will likely put less constraints on how reference text can be made in the future. I would like to know the opinion of the other experienced members.

Danny_B changed the task status from Duplicate to Resolved.Apr 11 2016, 10:20 PM

Duplicating in opposite way in favour of the older task which has longer history and other dupes attached.

Izno added a subscriber: Izno.Apr 11 2016, 10:57 PM

Duplicating in opposite way in favour of the older task which has longer history and other dupes attached.

Someone has a patch for review on this one, however, and is actively working it.

The choice to merge the other task here was deliberate.

Commit message can be changed to reflect the original task number...