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] Link text is overwritten when using markdown links #22

Open
jayemar opened this issue Oct 21, 2024 · 1 comment
Open

[BUG] Link text is overwritten when using markdown links #22

jayemar opened this issue Oct 21, 2024 · 1 comment

Comments

@jayemar
Copy link

jayemar commented Oct 21, 2024

Describe the bug
If using markdown links instead of wiki links, selecting text and creating a link using "Link with alias" overwrites the selected text with the link itself instead of using the selected text as the link text.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Settings -> Files and links -> and disable "Use [[Wikilinks]]"
  2. Go to Settings -> Community plugins -> Link with alias -> click the gear cog and unselect "Copy selected text as link file"
  3. From with a note, select some text and then run command "Link with alias: create link with alias".
  4. You should now be inside of a newly created link with auto complete enabled to input a link. Start typing to select a note to link to. When you select a note, the highlighted text will be replaced with the link for the selected note, replacing the highlighted text.

Expected behavior
Everything works as expected until item 4 above. When I select a note, I expect that note to be used as the link inside the parentheses of the new markdown link, and the highlighted text to be used as the link text within the square brackets.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional Information
Current example:
highlighted text -> my note file

Expected:
highlighted text -> highlighted text

@pvojtechovsky
Copy link
Owner

Thanks for reporting. I was able to reproduce this problem.

I am quite busy with other stuff, so I have no time to fix it soon.
If anybody is willing to have a look and fix it then here

setLinkText(cacheLink, editor, lastLink.linkText);

is the place which should be checked.

Note: I never tried to switch off Wiki links. I like wiki links so it fits to my purposes. Therefore it is not urgent problem for me and has no priority for me. Anyway I confirm that it is bug, which should be solved and I will welcome a related pull request and I want to provide some technical support to fix the problem if needed.

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

No branches or pull requests

2 participants