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] Standardize meaning of "Title" in link dialog #443

Open
2 tasks done
braincore opened this issue May 3, 2024 · 2 comments
Open
2 tasks done

[BUG] Standardize meaning of "Title" in link dialog #443

braincore opened this issue May 3, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@braincore
Copy link
Contributor

If you want to ask for support or request features, sponsor the project and contact me over email.

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • I have read the documentation and cannot find an answer.

Describe the bug
When a link is first created, the "Title" field indicates the anchor text. However, if the link is edited, the "Title" field will add a Markdown link-title while confusingly being populated by the anchor text.

Expected behavior
While I can't speak for all use cases, I suspect the Markdown link-title has little utility compared to the anchor text. I recommend making the anchor text modifiable with the current field (rename "Title" to "Link Text"/"Text"). Optionally, add a new and separate field for link-title that can be specified on link creation, but consider adding a flag to omit it.

@braincore braincore added the bug Something isn't working label May 3, 2024
@petyosi
Copy link
Contributor

petyosi commented May 3, 2024

I agree with you. The only reason for this behavior is a lack of resources on my side. Implementing a separate field for the link text is the way to go, but then there's complexity coming from the fact, that the link may contain formatting or even images - how are those represented? Notion solves this in a way, by converting to plain text, but then changing the plain text loses the formatting.

Of course, the field might be shown only if no selection is present, but then it becomes inconsistent.

@braincore
Copy link
Contributor Author

The complexity of non-text anchors makes sense. For anyone deciding to submit a PR, the short term solution then is to:

  1. When creating a new link, have two distinct fields: anchor text and link-title.
  2. When modifying a link, omit the anchor text field (cannot be changed), and have the link-title input be strictly the existing link-title.
  3. Have a flag to hide the link-title input in LinkDialog for both the creation and modification flows.

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

2 participants