Link not fully linkified

I have TW 5.2.7 on Tiddlyhost. This tiddler uses Wiki text. This is an example of one link that did not get linkified because of the characters “[” and “]”.

https://www.ncbi.nlm.nih.gov/pubmed?term=%22Electromagnetic+Fields/adverse+effects%22[MeSH+Terms]

  • Can Tiddlywiki be adjusted to include the left and right brackets in linkification?
  • Is it possible for me to make this change myself without upgrading the TW file?

TiddlyWiki has several ways to create external links (i.e., links to other sites, not links to tiddlers).

  • Any text separated by whitespace that starts with certain “protocol” sequences such as “http://”, “https://” is handled by the “extlink” wikirule. The following protocols (defined in $:/core/modules/parsers/wikiparser/rules/extlink.js) are recognized by the TWCore: file|http|https|mailto|ftp|irc|news|data|skype.

  • Alternatively, you can use the [ext[...]] wikitext syntax to enclose any external link, even if it uses a protocol that is not one of those shown above. However, because this syntax uses square brackets as delimiters, you can’t specify a URL that contains square brackets, which is the problem you encountered.

  • One way around this is to “URL encode” the square brackets, using %5B for [ and %5D for ]. Of course, this is a bit of a nuisance, since you have to hand-edit the URL to change the square brackets to URL encoded sequences.

  • Fortunately, there is an easier way to deal with the offending URL, by using HTML <a href=...> (anchor) syntax, like this:

<a target="_blank" href="https://www.ncbi.nlm.nih.gov/pubmed?term=%22Electromagnetic+Fields/adverse+effects%22[MeSH+Terms]">link text</a>

Note the addition of target="_blank". This makes the link open in a new browser tab, so that clicking the link won’t cause the current tab to exit your loaded TiddlyWiki.

enjoy,
-e

1 Like

You can use the [ext[link]] wikitext. It should be possible to use " instead of %22

[ext[https://pubmed.ncbi.nlm.nih.gov/?term="Electromagnetic+Fields/adverse+effects"[MeSH+Terms]]]

See: https://tiddlywiki.com/#Linking%20in%20WikiText

Just confirming this worked. Thank you!