Skip to content

Instantly share code, notes, and snippets.

View josephcooney's full-sized avatar

Joseph Cooney josephcooney

View GitHub Profile
ko.bindingHandlers.tagValue = {
init: function (element, valueAccessor, allBindings, viewModel, bindingContext) {
var replaceTags = function(taggedString, targetUrl, linkClass) {
if (!taggedString) {
return null;
}
var exp = /(^#|\W#)[\w-_]+/g;
var match = taggedString.match(exp);