typst / biblatex

A Rust crate for parsing and writing BibTeX and BibLaTeX files.
Apache License 2.0
120 stars 15 forks source link

Whitespaces in field value #41

Closed zepinglee closed 7 months ago

zepinglee commented 8 months ago

This parser produces extra whitespaces if the field value is in multiple lines. Yet BibTeX/Biber compresses whitespaces in field value to a single space and removes leading or trailing whitespaces.

@article{aksin,
  title        = {Effect of immobilization on catalytic characteristics of
                  saturated {Pd-N}-heterocyclic carbenes in {Mizoroki-Heck}
                  reactions},
}
---- tests::test_whitespaces stdout ----
Bibliography {
    entries: [
        Entry {
            key: "aksin",
            entry_type: Article,
            fields: {
                "title": [
                    Normal(
                        "Effect of immobilization on catalytic characteristics of\n                  saturated ",
                    ) <34..119>,
                    Verbatim(
                        "Pd-N",
                    ) <120..124>,
                    Normal(
                        "-heterocyclic carbenes in ",
                    ) <125..151>,
                    Verbatim(
                        "Mizoroki-Heck",
                    ) <152..165>,
                    Normal(
                        "\n                  reactions",
                    ) <166..194>,
                ],
            },
        },
    ],
    keys: {
        "aksin": 0,
    },
}