Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

rgieseke
Copy link
Contributor

@rgieseke rgieseke commented Jul 6, 2021

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
Copy link
Member

nokome commented Jul 7, 2021

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
Copy link
Contributor Author

rgieseke commented Jul 7, 2021

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
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