feat: allow multiple references in citation#310
Conversation
Codecov Report
@@ Coverage Diff @@
## main #310 +/- ##
==========================================
+ Coverage 86.47% 88.48% +2.01%
==========================================
Files 137 144 +7
Lines 7577 7949 +372
Branches 833 927 +94
==========================================
+ Hits 6552 7034 +482
+ Misses 1011 901 -110
Partials 14 14
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
nice! Check out CSL for where we are going next … https://citationstyles.org/ |
cguedes
left a comment
There was a problem hiding this comment.
Great work 👏 .
Just a note about which HTML element should we use for citations and some couple minor comments.
| * Plugin that prevents the cursor from being directly after the opening and closing brackets of citation nodes | ||
| */ | ||
| const moveCursorPluginKey = new PluginKey('moveCursor'); | ||
| const moveCursorPlugin = new Plugin({ |
There was a problem hiding this comment.
not directly related to this (I think!) but can we make the cursor | visible inside the citation node?
There was a problem hiding this comment.
I agree that is really annoying but I don't see any easy fix. The issue is that when there is a reference node followed by the end of the citation node, there is no text node in between (because empty text nodes are not valid), so the cursor doesn't show
Closes #287
This adds a new
citationnode, that contains text and references.The node can be created by typing
[in the document.references can now be inserted with the character@, but only incitationnodesInserting a
citationautomatically opens the reference pickerWhen at the end of a citation node, after a reference, typing anything will add
;before the added contentScreen.Recording.2023-07-18.at.12.26.43.mov
NB: References are now rendered with a React component, which means we can completely customise them, for example by having the name of the reference instead of the citation key, and making them hyperlinks that open the corresponding document. This also means that updating a reference in the reference table now updates it in the editor too.