> -------------------
> config.textPrimitives.urlPattern = "(?:spotify|file|http|https|mailto|
> ftp|irc|news|data):[^\\s'\"]+(?:/|\\b)";
> -------------------
> after saving and reloading, "PrettyLinks" using "spotify:" as the
> protocol should then be recognized as external URLs

Interestingly, that doesn't make Spotify URIs be picked up automatically 
(without the use of PrettyLinks) - I haven't looked into this yet, but I 
assume it's a load-order issue.

The following adds an additional formatter for that purpose:
---------------
/***
spotify:foo
[[bar|spotify:bar]]
***/
//{{{
config.textPrimitives.urlPattern = config.textPrimitives.urlPattern.
     replace("data", "data|spotify");

config.formatters.push({
     name: "spotifyLink",
     match: "spotify:.+",
     handler: function(w) {
         w.outputText(createExternalLink(w.output,w.matchText),
             w.matchStart,w.nextMatch);
     }
});
//}}}
---------------
(There should be a more elegant solution though, e.g. reusing the 
urlLink formatter - I might look into that another day).


-- F.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/TiddlyWiki?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to