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

WIP: Fix wikilinks slug querying #386

Merged
merged 2 commits into from
Nov 28, 2020

Conversation

SanketDG
Copy link
Contributor

This attempts to fix the wikilink generation issues.

@@ -91,7 +91,7 @@ export class NoteGraph implements NoteGraphAPI {
// prettier-ignore
const filterFn =
query == null ? (note: Note | null) => note != null
: 'slug' in query ? (note: Note | null) => note?.slug === query.slug
: 'slug' in query ? (note: Note | null) => [nameToSlug(query.slug), query.slug].includes(note?.slug as string)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am checking for both [[Slug Name]] and [[slug-name]] here, however they are defined in the note, so both can be used interchangably.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SanketDG I have a feeling this wouldn't work with the dataviz graph, have you tested it?

Copy link
Contributor Author

@SanketDG SanketDG Nov 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it definitely works with my notes, which all have filenames like "javascript-execution.md" and referenced as [[Javascript Execution]], this is uniform throughout.

Any other cases you want me to check?

Copy link
Collaborator

@riccardoferretti riccardoferretti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@riccardoferretti riccardoferretti marked this pull request as ready for review November 28, 2020 14:04
@riccardoferretti riccardoferretti merged commit 6073bf1 into foambubble:master Nov 28, 2020
@SanketDG SanketDG deleted the sanketdg/wikilinks-fix branch November 29, 2020 08:39
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

Successfully merging this pull request may close these issues.

2 participants