mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
FIX: Post does not save if it contains a tag link
This commit is contained in:
parent
ad2a3ec5bc
commit
d25dc126f7
2 changed files with 13 additions and 1 deletions
|
@ -3,6 +3,7 @@ require 'nokogiri'
|
|||
require_dependency 'url_helper'
|
||||
require_dependency 'excerpt_parser'
|
||||
require_dependency 'post'
|
||||
require_dependency 'discourse_tagging'
|
||||
|
||||
module PrettyText
|
||||
|
||||
|
@ -74,7 +75,7 @@ module PrettyText
|
|||
|
||||
if !is_tag && category = Category.query_from_hashtag_slug(text)
|
||||
[category.url_with_id, text]
|
||||
elsif is_tag && tag = TopicCustomField.find_by(name: TAGS_FIELD_NAME, value: text.gsub!("#{tag_postfix}", ''))
|
||||
elsif is_tag && tag = TopicCustomField.find_by(name: DiscourseTagging::TAGS_FIELD_NAME, value: text.gsub!("#{tag_postfix}", ''))
|
||||
["#{Discourse.base_url}/tags/#{tag.value}", text]
|
||||
else
|
||||
nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue