Skip to content

[pyos][bug] Undocumented multiline string format #18

@sneakers-the-rat

Description

@sneakers-the-rat

Part of: pyOpenSci/software-submission#267 (comment)

If a block in an input file has multiple lines, and none of them are a DOI or URL, the first line is interpreted as the title and the second line is interpreted as the authors:

OneCite/onecite/pipeline.py

Lines 144 to 147 in 12b1dea

if not raw_entry['doi'] and not raw_entry['url']:
lines = [ln.strip() for ln in block.splitlines() if ln.strip()]
title_text = lines[0] if lines else block
authors_text = lines[1] if len(lines) > 1 else ''

However that's not actually used as fields in further queries, and instead the effect of that code is to truncate the query string so only the first two lines are searched.

I can't see description of multiline input in the documentation anywhere - the documentation actually incorrectly suggests that multiple items can be places on adjacent lines (without double linebreaks) as the first example -

10.1038/nature14539

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions