diff --git a/lib/asciidoctor-bibtex/extensions.rb b/lib/asciidoctor-bibtex/extensions.rb index 7d96d7b..aafef56 100644 --- a/lib/asciidoctor-bibtex/extensions.rb +++ b/lib/asciidoctor-bibtex/extensions.rb @@ -71,7 +71,7 @@ def process(document) # Fild bibtex file automatically if not supplied. if bibtex_file.empty? - bibtex_file = AsciidoctorBibtex::PathUtils.find_bibfile document.basedir + bibtex_file = AsciidoctorBibtex::PathUtils.find_bibfile document.base_dir end if bibtex_file.empty? bibtex_file = AsciidoctorBibtex::PathUtils.find_bibfile '.' @@ -100,7 +100,10 @@ def process(document) # First pass: extract all citations. prose_blocks.each do |block| if block.context == :list_item || block.context == :table_cell - line = block.text + # NOTE: we access the instance variable @text for raw text. + # Otherwise the footnotes in the text will be pre-processed and + # ghost footnotes will be inserted (as of asciidoctor 2.0.10). + line = block.instance_variable_get(:@text) unless line.nil? || line.empty? processor.process_citation_macros line end @@ -109,7 +112,7 @@ def process(document) processor.process_citation_macros line end else - line = block.title + line = block.instance_variable_get(:@title) processor.process_citation_macros line end end @@ -136,7 +139,7 @@ def process(document) # NOTE: we access the instance variable @text for raw text. line = block.instance_variable_get(:@title) line = processor.replace_citation_macros(line) - # line = processor.replace_bibitem_macros(line) + line = processor.replace_bibitem_macros(line) block.title = line end end diff --git a/samples/dup-of-footnotes/test.adoc b/samples/dup-of-footnotes/test.adoc new file mode 100644 index 0000000..0e34688 --- /dev/null +++ b/samples/dup-of-footnotes/test.adoc @@ -0,0 +1,10 @@ += Test File + +== Heading 1 + +Some text with footnote footnote:[words0] + +Some text with footnote footnote:[words1] + +* Some list text with footnote footnote:[list0] +* Some list text with footnote footnote:[list1] diff --git a/samples/dup-of-footnotes/test.bib b/samples/dup-of-footnotes/test.bib new file mode 100644 index 0000000..e69de29