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

.mentions is empty #521

Open
jgclark opened this issue Jan 27, 2024 · 0 comments
Open

.mentions is empty #521

jgclark opened this issue Jan 27, 2024 · 0 comments
Assignees
Labels
API bug Something isn't working P-5 Priority 5 (med)

Comments

@jgclark
Copy link
Collaborator

jgclark commented Jan 27, 2024

Here's an ancient problem that I'd like to see cleared up, in order to make progress on new features for Project + Reviews plugin.

The plugin depends on reading metadata in notes, for example
#area @start(2021-09-29) @review(6w) @reviewed(2023-06-23)

To do this I first try to get the list of all mentions:

let mentions: $ReadOnlyArray<string> = note.mentions ?? []

but normally it finds none, despite there being many in the note.

So I then have to use this fallback:

const metadataLineIndex = getOrMakeMetadataLine(note)
let metadataLine = paras[metadataLineIndex].content
mentions = (metadataLine + ' ').split(' ').filter((f) => f[0] === '@')

I've put a warning in the plugin-side docs that this call is unreliable.

@jgclark jgclark added bug Something isn't working API P-5 Priority 5 (med) labels Jan 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API bug Something isn't working P-5 Priority 5 (med)
Projects
None yet
Development

No branches or pull requests

2 participants