fiduswriter / biblatex-csl-converter

A set of JavaScript converters: bib(la)tex => json, json => csl, and json => biblatex
GNU Lesser General Public License v3.0
34 stars 10 forks source link

nocase nesting #104

Open retorquere opened 5 years ago

retorquere commented 5 years ago

With this script:

const BibLatexParser = require('biblatex-csl-converter').BibLatexParser

const input = `
@article{Adams2001,
  title = {{The \\emph{physical} volcanology of the 1600 eruption of Huaynaputina, southern Peru}},
}
`

let parser = new BibLatexParser(input, {
    processUnexpected: true,
    processUnknown: { comment: 'f_verbatim' },
    processInvalidURIs: true,
});

let bib = parser.parse()
console.log(JSON.stringify(bib.entries['1'].fields.title, null, 2))

I'm getting

[
  {
    "type": "text",
    "text": "The ",
    "marks": [
      {
        "type": "nocase"
      }
    ]
  },
  {
    "type": "text",
    "text": "physical",
    "marks": [
      {
        "type": "em"
      }
    ]
  },
  {
    "type": "text",
    "text": " volcanology of the 1600 eruption of Huaynaputina, southern Peru"
  }
]

which leaves the part after the emph section unprotected. This isn't expected right?

retorquere commented 5 years ago

It's not an effect of the change in 1.6.9, 1.6.8 exhibits the same behavior.

retorquere commented 5 years ago

This goes back to at least 1.5.0. I don't honestly know enough about the parser to know where to begin to look.