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

BUG: Incorrect warning of non-existent page #61

Open
carbontwelve opened this issue Oct 25, 2024 · 3 comments
Open

BUG: Incorrect warning of non-existent page #61

carbontwelve opened this issue Oct 25, 2024 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@carbontwelve
Copy link
Contributor

image

Where it's reporting WARNING Wikilink ([[Stubs]]) found pointing to to non-existent page it is incorrect, the Stubs page does exist and has its alias set.

@carbontwelve carbontwelve added the bug Something isn't working label Oct 25, 2024
@carbontwelve carbontwelve added this to the v1.1.0 milestone Oct 25, 2024
@carbontwelve
Copy link
Contributor Author

Throwing a debugger into the mix I can see the link object is correct:
image

It should pick up the page page.data.title === 'Stub Posts' by its alias:

const aliases = ((page.data.aliases && Array.isArray(page.data.aliases)) ? page.data.aliases : []).reduce(function (set, alias) {
  set.add(alias);
  return set;
}, new Set());

The issue here is that I am using alias in my front matter, which wont work, it should be aliases. However, the above code assumes that aliases will be an array, when it could also be a single entry as a string.

@carbontwelve
Copy link
Contributor Author

One problem down (and a new issue opened) I can see now that there is still an issue:

[@photogabble/wikilinks] WARNING Link (href="/topic/game-development/") found pointing to to non-existent page in:
        - ./src/about.njk
[@photogabble/wikilinks] WARNING Link (href="/topic/dos/") found pointing to to non-existent page in:
        - ./src/about.njk

I know both of these links are to pages that exist, the question is do they exist at the time when this is looking up their onward location?

@carbontwelve carbontwelve self-assigned this Oct 27, 2024
@carbontwelve
Copy link
Contributor Author

carbontwelve commented Oct 27, 2024

image

It appears the links discovered by their href do not get the isPath flag set on their link object. I have checked and the file being linked to can be looked up by filePathStem so this is a bug.

To fix it the isPath value of a link object must be true if created from an HTML <a> tag.

Edit: getting some weirdness in my debugger for HTMLLinkParser.parseSingle:
image

That meta value does not match what the code should be doing with the link value.

@carbontwelve carbontwelve modified the milestones: v1.1.0, v1.1.1 Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant