Convert to link as long as a valid link is received.
This commit is contained in:
parent
190345ba20
commit
e8c5127865
|
@ -14,8 +14,8 @@ Discourse.Dialect.inlineRegexp({
|
|||
categoryHashtagLookup = this.dialect.options.categoryHashtagLookup,
|
||||
result = categoryHashtagLookup && categoryHashtagLookup(slug);
|
||||
|
||||
if (result && result[0] === "category") {
|
||||
return ['a', { class: attributeClass, href: result[1] }, '#', ["span", {}, slug]];
|
||||
if (result) {
|
||||
return ['a', { class: attributeClass, href: result }, '#', ["span", {}, slug]];
|
||||
} else {
|
||||
return ['span', { class: attributeClass }, hashtag];
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ module PrettyText
|
|||
|
||||
def category_hashtag_lookup(category_slug)
|
||||
if category = Category.query_from_hashtag_slug(category_slug)
|
||||
['category', category.url_with_id]
|
||||
category.url_with_id
|
||||
else
|
||||
nil
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue