Skip to content

fix(ui): don't send empty csl through citeproc

Dan Visel requested to merge citation-style-change-fix into main

Ryan noted a problem visible in the edit modal: #1329 (comment 129907)

What's happening is that if you go to the Edit modal with an original citation – so that it's just the formatted string of text, there's no internal CSL as you'd get with a citation result from Anystyle or Crossref – a useEffect is sending the CSL through CiteProc to get the initial rendering; so after a moment, you see a mostly empty string. This change makes sure we don't actually send (mostly) empty CSL through Citeproc. If the user has changed any of the fields, then we should send it through Citeproc, because then we have some actual CSL.

Merge request reports