inukshuk/citeproc-ruby

Title casing results in invalid HTML escape sequences

Closed this issue · 2 comments

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.

Good catch, thanks!

And impressive one-word fix, thanks!