Skip to content

Commit

Permalink
Using locator functionality of CiteProc class for pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Schlichenmaier committed Mar 10, 2019
1 parent a2de161 commit 5344fc2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/asciidoctor-bibtex/processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,19 +172,19 @@ def make_citation item, ref, cite_data, cite
fc = '['
lc = ']'
else
cite_text = @citeproc.process id: ref, mode: :citation
cite_text = @citeproc.process id: ref, mode: :citation, locator: cite.pages
fc = ''
lc = ''
end

if Styles.is_numeric? @style
cite_text << "#{page_str(cite)}"
elsif cite_data.type == "citenp"
cite_text.gsub!(item.year, "#{fc}#{item.year}#{page_str(cite)}#{lc}")
cite_text.gsub!(", #{fc}", " #{fc}")
else
cite_text << page_str(cite)
end
# if Styles.is_numeric? @style
# cite_text << "#{page_str(cite)}"
# elsif cite_data.type == "citenp"
# cite_text.gsub!(item.year, "#{fc}#{item.year}#{page_str(cite)}#{lc}")
# cite_text.gsub!(", #{fc}", " #{fc}")
# else
# cite_text << page_str(cite)
# end

cite_text.gsub!(",", "&#44;") if @links # replace comma

Expand Down

0 comments on commit 5344fc2

Please sign in to comment.