elifesciences / elife-tools

Python library for parsing eLife article XML data.
MIT License
15 stars 7 forks source link

body_block_content() disp-quote, add more blocks. #400

Closed gnott closed 2 years ago

gnott commented 2 years ago

Re issue https://github.com/elifesciences/issues/issues/7700

When a <disp-quote content-type="editor-comment"> XML tag is parsed, it produces an excerpt block in the JSON format of the article. Though a <disp-quote> tag with no attribute produces a quote block.

This library was only allowing p tag content to be included. quote block only allows paragraph, according to the JSON schema, but excerpt allows more block types: code, list, mathml, paragraph, and table.

The code fix here supports those additional types of blocks when parsing a <disp-quote> tag into JSON content blocks.