Skip to main content

Module markup

Module markup 

Source
Expand description

Plain text from publisher metadata strings that carry inline markup.

Crossref serves titles as the publisher deposited them, and several publishers deposit JATS / MathML inline elements pretty-printed onto their own lines (#609):

"Recent developments in the P\n                    <scp>y</scp>\n                    SCF program package"

Stripping the tags is not enough. The newline-plus-indent runs around an inline element were added by the pretty-printer, so they say nothing about whether the author wrote a space there: P<scp>y</scp>SCF is one word, in <i>γ</i>-InSe is two. plain_title decides each such run from its neighbours; the rules are pinned against real deposits in the tests below.

Whitespace that is not a pretty-printer run (no line break, or no tag beside it) collapses to one space, and $...$ is left alone: a hand-written TeX title is content, which doiget lint already treats as intentional.

Functions§

has_inline_markup
Whether s carries a line break or an inline markup tag, i.e. whether plain_title would rewrite more than entities. doiget lint uses this to find entries pasted from an older doiget cite (#609).
plain_title
raw with inline markup reduced to its text content, XML entities decoded and whitespace collapsed. A string with no tag, entity or line break is returned unchanged.