Skip to content

Commit

Permalink
TW-269 - modified Source::Bibtex to use a fake year and then remove i…
Browse files Browse the repository at this point in the history
…t from the string when computing the cached string.
  • Loading branch information
BethFrank committed May 1, 2015
1 parent ede7aa4 commit cab0436
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/models/source/bibtex.rb
Original file line number Diff line number Diff line change
Expand Up @@ -710,13 +710,19 @@ def cached_string(format)
bx_entry.key = 'tmpID'
end

if bx_entry.year.blank? # cludge to fix render problem with year
bx_entry.year = '0000'
end

key = bx_entry.key
bx_bibliography = BibTeX::Bibliography.new
bx_bibliography.add(bx_entry)

cp = CiteProc::Processor.new(style: 'zootaxa', format: format)
cp.import(bx_bibliography.to_citeproc)
cp.render(:bibliography, id: key).first.strip
output = cp.render(:bibliography, id: key).first.strip

output.sub('(0ADAD)', '') # citeproc renders year 0000 as (0ADAD)
end

protected
Expand Down

0 comments on commit cab0436

Please sign in to comment.