Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Citation references rendering broken if used within stylistic quotation marks #93

Open
odrotbohm opened this issue May 4, 2023 · 5 comments

Comments

@odrotbohm
Copy link

This is probably an issue in the interaction of Asciidoctor PDF and the asciidoctor-bibtex extension. The usage of a cite:[…] expression within standard quotation marks renders citation keys just fine:

"some text cite:[foo42] some text" -> some text [1] some text

If one uses stylistic quotation marks, the output changes to this:

"`some text cite:[foo42] some text`" -> some text +[+1+]+ some text

Not the erroneous plus characters in the output. I suspect the single backticks to trigger some substitutions being applied?

@mojavelinux
Copy link
Member

At first glance, this does appear to be a problem with how the bibtex extension is implemented. I'm not at all familiar with that extension, so I can only really guess why this might be happening. It seems as though it is either adding markup that cannot be parsed or not replacing its own placeholders.

Would you be okay with me moving this issue to that repository? I'm not sure what I'd be able to do in Asciidoctor PDF to address it until it is investigated on that side.

@odrotbohm
Copy link
Author

Sure thing. I superficially skimmed through its sources but lack any kind of knowledge about the escaping logic for their placeholders etc.

@mojavelinux
Copy link
Member

I'll dive in myself and chime in with what I find.

@mojavelinux mojavelinux transferred this issue from asciidoctor/asciidoctor-pdf May 4, 2023
@mojavelinux
Copy link
Member

I can't reproduce this problem unless I enable compat-mode (and even then the results are slightly different). Do you have compat-mode enabled?

Here are the files I used to test:

sample.adoc

= Basic Example of asciidoctor-bibtex
:bibtex-file: references.bib
:bibtex-order: alphabetical
:bibtex-style: ieee

== Main

"`some text cite:[foo42] some text`"

== Bibliography

bibliography::references.bib[ieee]

references.bib

@book{foo42, author={Foo Bar}, title={Good Stuff}, publisher={New York Press}, year={2020}}

Asciidoctor PDF 2.3.7, Asciidoctor 2.0.20, and Asciidoctor Bibtex 0.8.0.

@mojavelinux
Copy link
Member

The reason there's a rendering problem in compat mode is because the replacement of the inline macro is not done using a custom inline macro (which would work within the parsing), but rather using search and replace. I've pointed out on multiple occasions that this extension is simply not implemented correctly in that regard. It's working outside of the parsing done by Asciidoctor and thus doesn't properly respect all the parsing rules and contexts. We cannot expect this extension to behavior properly until that's addressed. That's not to say it isn't useful, but we do have to set some expectations here about what the reliability of this extension is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants