inukshuk / citeproc-ruby

A Citation Style Language (CSL) Cite Processor
101 stars 22 forks source link

Title casing results in invalid HTML escape sequences #44

Closed RubenVerborgh closed 7 years ago

RubenVerborgh commented 7 years ago

When trying the following code with citeproc-ruby 1.1.5:

require 'citeproc'
require 'csl/styles'

cp = CiteProc::Processor.new format: 'html'
cp << CiteProc::CitationItem.new(
  :id => 'test',
  :author => 'First Last',
  :'container-title' => 'one & two & three',
)
puts cp.render(:bibliography, id: 'test').first

the output is

Last, First. n.d. <i>One &Amp; Two &Amp; Three</i>.

whereas it should be

Last, First. n.d. <i>One &amp; Two &amp; Three</i>.

Note how the &amp; escape sequence incorrectly was capitalized; i.e., it seems that capitalization is applied after HTML instead of before, while it should be the other way round.

inukshuk commented 7 years ago

Good catch, thanks!

RubenVerborgh commented 7 years ago

And impressive one-word fix, thanks!