Skip to content

fix(JATS): Don't duplicate footnote content in abstract - #969

Open
rgieseke wants to merge 6 commits into
stencila:masterfrom
rgieseke:jats-fix-footnote-in-abstract
Open

fix(JATS): Don't duplicate footnote content in abstract#969
rgieseke wants to merge 6 commits into
stencila:masterfrom
rgieseke:jats-fix-footnote-in-abstract

Conversation

@rgieseke

@rgieseke rgieseke commented Jul 6, 2021

Copy link
Copy Markdown
Contributor

Previously all <p>s in an abstract would be rendered. With footnotes
a paragraph can appear nested "inside" of a paragraph.

Before:

{
  "type": "Article",
  "description": [
    {
      "type": "Paragraph",
      "content": [
        "The abstract can contain a footnote.",
        {
          "type": "Note",
          "id": "note-1",
          "noteType": "Footnote",
          "content": [
            {
              "type": "Paragraph",
              "id": "footnote1",
              "content": [
                "A footnote from the abstract."
              ]
            }
          ]
        }
      ]
    },
    {
      "type": "Paragraph",
      "id": "footnote1",
      "content": [
        "A footnote from the abstract."
      ]
    }
  ],

With using children instead of all:

  "type": "Article",
  "description": [
    "The abstract can contain a footnote.",
    {
      "type": "Note",
      "id": "note-1",
      "noteType": "Footnote",
      "content": [
        {
          "type": "Paragraph",
          "id": "footnote1",
          "content": [
            "A footnote from the abstract."
          ]
        }
      ]
    }
  ],

I tried updating the fixtures, but couldn't get it to work, even with --clearCache.

Previously all `<p>`s would be rendered. With footnotes
a paragraph can appear nested "inside" of a paragraph.
@nokome

nokome commented Jul 7, 2021

Copy link
Copy Markdown
Member

Thanks for this fix. I have updated the snapshots locally and unfortunately it breaks the snapshot src/codecs/plos/__file_snapshots__/pmed-1002858.yaml by removing the abstract completely: https://dev.azure.com/stencila/stencila/_build/results?buildId=14028&view=logs&j=0da5d1d9-276d-5173-c4c4-9d4d4ed14fdb&t=d9b15392-e4ce-5e4c-0c8c-b69645229181&l=2005. I'll look into it some more - it may need on level of unwrapping of the abstract contents.

@rgieseke

rgieseke commented Jul 7, 2021

Copy link
Copy Markdown
Contributor Author

That's ... a problem! I just tested adding more paragraphs to the abstact in __fixtures__/footnote.xml and those didn't disappear.

@rgieseke

Copy link
Copy Markdown
Contributor Author

I looked a bit into the plos problem, but couldn't figure it out. I thought the decoder should be able to handle an array of paragraphs as an abstract.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants