Giter Site home page Giter Site logo

Comments (6)

benthamite avatar benthamite commented on August 19, 2024 1

By the way, in case this is helpful to others, the reason we were getting different values for prenote and postnote (as I just realized) is that I have citar-markdown-prompt-for-extra-arguments set to nil. Because I am not prompted for a prefix or a suffix, the value of those variables ends up being nil rather than an empty string.

from citar.

bdarcus avatar bdarcus commented on August 19, 2024

That's weird; testing just now, I don't see that. This is what I get when inserting without affix and with respectively.

# Testing ...

[@burwell2014]

[see  @kohn2008, p12]

from citar.

benthamite avatar benthamite commented on August 19, 2024

Okay, I now realize that this is not an intended behavior: looking at citar-markdown-insert-citation more carefully, I see that when the value of prenote and postnote is an empty string, it should not insert any extra characters. When I run edebug on citar-markdown-insert-citation, I see that prenote and postnote are evaluated to nil, so (string= "" prenote) and (string= "" postnote) evaluate to nil, and as a consequence prenote and postnote are assigned the values (concat prenote " ") and (concat ", " postnote), respectively.

Presumably in your case the value of prenote and postnote is an empty string rather than nil, which would explain why the citations are inserted without any extra characters. Do you have a sense of what might be causing the difference in the values of those two variables between us?

from citar.

bdarcus avatar bdarcus commented on August 19, 2024

No; I tried in both my default doom setup, and a minimal custom one.

Seems regardless it would be better for it to check for a non-empty string?

Care to submit a PR for that?

from citar.

benthamite avatar benthamite commented on August 19, 2024

Sure. To confirm, this would just involve replacing (string= "" prenote) with (= (length prenote) 0), and (string= "" postnote) with (= (length postnote) 0), in citar-markdown-insert-citation, right?

from citar.

bdarcus avatar bdarcus commented on August 19, 2024

from citar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.