Extract and save references - extra line spacing


If I have to add references to the metadata after publishing the article, I have to use the so called ‘Extract and save references’, but then I have to accept some extra line spacing, an empty line between the references. Can I in any way prevent that?


I’ve observed another error when using ‘Extracted References’. When I make the following extraction the number (21) in the very first reference is missing in the extracted references:


The problem is here:

We’re trying to strip out the numbering from numbered citations, but there isn’t clear definition of when the numbering ends. As the code stands, the number could optionally end with a period, close parenthesis, closing square brace, plus 0 or more spaces. The “21” in “21st” matches this and is stripped.

Our regex here needs to consider this.

In your original question, is the “empty line” between references present in the actual data (as a blank reference), or is this just a matter spacing within the display?


Thank you.
And to your last question, the “empty line” (as a blank reference) shows up after publishing. Below you see a before and after using the extract. That is the way it is presented to the reader



If you use your browser’s Web Inspector tool to examine the page source, you’ll find that these references are contained within p tags. You browser is applying default paragraph styling to the p tag.

<div class="item references">
  <h3 class="label">References</h3>
  <div class="value">
    <p>Reference, Test: One. </p>
    <p>Reference, Test: Two. </p>																		 

To alter the display, add some custom CSS to override the margin property/properties which are adding this space, for example:

div.references div.value p {
    margin-block-start: 0;
    margin-block-end: 0;


Why don’t you use the br tag instead?


The <br /> tag represents a structural markup tag rather than a semantic markup tag. The use of classing and ids on semantically relevant tags is preferred because it allows increased flexibility for styling (via CSS) and increased machine readability.

An alternate question could be: why were <p> tags used instead of <div> tags, or (even better) <li> tags? These references do not represent paragraph content in my mind.


I would really prefer a div tag instead of the p tag. Then you can maintain the original formatting (see the above - before/after)


The formatting is completely arbitrary; it is entirely based on your selected CSS.

That said, I think I see what you were getting at with respect to the <br /> tag. If references are parsed, they are displayed in <p> tags. If the references are not parsed, they are reformatted with <br /> tags separating each.

I think a better structure would be to always output them as an unordered list, classed to whether they are parsed or not.

The formatting would still be up to your CSS declarations, but the structure would be internally consistent and meaningful.