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

Feature Request: @[[Name]] #15

Open
luislopes-outsystems opened this issue Aug 8, 2023 · 1 comment
Open

Feature Request: @[[Name]] #15

luislopes-outsystems opened this issue Aug 8, 2023 · 1 comment

Comments

@luislopes-outsystems
Copy link

luislopes-outsystems commented Aug 8, 2023

Hi, I don't know if this specific use case is something that only fits me, but I have notes related with a person, and sometimes I don't remember who is who, so I do a person note with their photo, information, etc.

So nowadays (without this extension) I usually mention people by [[Person]]...
So I'm wondering if there would be a possibility to generate some @[[Person]] mentions instead that would be considered mentions, and be links to a file all the same.

Alternatively, keep the mentions as they are, but allowing to create a note related the @person mention. idk if this makes sense..

Regards,

@tophee
Copy link

tophee commented Oct 5, 2023

I am looking for basically the exact same feature! (My Idea was, to have the @ sign as part of the note name so that typing @person would be turned into [[@person]].

For somebody who knows what they're doing, this would probably be a rather small change because as far as I understand, the current code wraps the mention in html tags (which remain invisible in Obsidian). For me, it would suffice to replace those tags with [[ and ]]. I believe this is the method that does the wrapping:

private surroundWithAnchorTag(text: string, className: string): HTMLAnchorElement {
const anchor = document.createElement('a');
anchor.addClass(className, 'preview');
anchor.textContent = text;
anchor.onClickEvent((_) => {
this.subscribers.forEach((s) => s(text));
});
return anchor;

ChatGPT suggests that this method simply needs to be replaced with something like this:

private surroundWithBracket(text: string): string {
    return `[[${text}]]`;
}

But I'm not sure how exactly to accomplish that.

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