Skip to content

Marker link multiple pages with same name path fix#480

Open
Feldherren wants to merge 3 commits into
javalent:mainfrom
Feldherren:marker-link-multiple-pages-with-same-name-path-fix
Open

Marker link multiple pages with same name path fix#480
Feldherren wants to merge 3 commits into
javalent:mainfrom
Feldherren:marker-link-multiple-pages-with-same-name-path-fix

Conversation

@Feldherren

@Feldherren Feldherren commented Jun 16, 2026

Copy link
Copy Markdown

Pull Request Description

When editing a marker, and linking a marker to a page, the dropdown/popup/modal correctly populates with all pages that have a name matching the entered text, including what folder the page is in if multiple copies of it exist. However, when a page that shares a name with another page in a different folder is selected, the resulting link to a page does not take this into account, so often a marker ends up linking to the wrong page.
This pull request fixes this behaviour.

Changes Proposed

  • Added getLinkText function to path.ts, which gets just a page name if unambiguous or gets the full path if more than one file exists with the same name (and also handles heading/id if entered)
  • Updated onChooseItem in path.ts to use getLinkText
  • Updated selectSuggestion in path.ts to use getLinkText

Related Issues

Fixes #450

Checklist

  • I have read the contribution guidelines and code of conduct.
  • I have tested the changes locally and they are working as expected.
  • I have added appropriate comments and documentation for the code changes.
  • My code follows the coding style and standards of this project.
  • I have rebased my branch on the latest main (or master) branch.
  • All tests (if applicable) have passed successfully.
  • I have run linters and fixed any issues.
  • I have checked for any potential security issues or vulnerabilities.

Screenshots (if applicable)

Entering the name of a page that is used for multiple pages:
image

Full path in Note to Open field:
image

Popup title (and preview) of page where the full path had to be used:
image

Pages that don't share their name with another page don't need or use the full path:
image

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.

🐞 Displaying wrong notre preview

1 participant