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
Include link text for links retrieved with getTiddlerLinks() #1749
Comments
Hi @felixhayashi the trouble is that computing the link text is actually a complex operation compared to computing link targets. Consider something like this:
To compute the link text requires walking through the parse tree nodes and concatenating the text. getTiddlerLinks() is highly performance sensitive, because it's called many times to compute missing and orphan links, so we don't want to make it any slower. It would make more sense to make a new method that did the additional processing. You could look at the existing getTiddlerLinks() code as a starting point. |
Hi Jeremy thanks for responding
No, there exist native properties that just return the combined text without markup:
For compatibility reasons: var text = el.innerText || el.textContent; My hotzone plugin uses this property to quickly extract the title from the tiddler frame:
-Felix |
That's a DOM function. Here we're dealing with a parse tree. |
Ehm ok. Then this would really be resource intensive I guess.
I agree that performance is a top prio here. Should I leave this ticket open anyways, so it may be picked up in the future by anyone? It is clearly not a must-have for me but would be a nice-to-have (for tiddlymap it would make sense in some occasions to be able to directly infer the edge name from the link alias). -Felix |
@felixhayashi we would definitely never change |
Is there anything left to be done about this? |
Nope |
@Jermolene does recent comment's change your minds ? |
Hi @ybabel I'm not against helping @felixhayashi fix that issue, but the proposal here is not a viable solution; we can't make such a deep change to the existing function |
thanks for the quick response. |
Hi, I created a general issue for this topic: #2144 -Felix |
I think @felixhayashi this one should stay closed. The OP makes a very specific proposal which has been categorically rejected. #2144 fixes the same underlying problem, but it doesn't really have a direct relationship with the OP here. |
Yes, I am also much in favour of #2144 but wasn't sure whether this one here was rejected. Now that you make it clear, I'll close it. |
Maybe it makes sense, if not only the linked tiddlers are retrieved when using
$tw.wiki.getTiddlerLinks
and $tw.wiki.getTiddlerBacklinks` but also any alias the user defined in relation with the link ("[[alias|SomeTiddlerTitle]]").I have to admit, I don't know how to deal with situations where two aliases point to the same tiddler...
Please note (2015-12-22): This issue is originally about making the link alias available (to machines). At some point in the discussion, we instead began talking more about semantic annotations, which is a different topic: #2144.
The text was updated successfully, but these errors were encountered: