mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-03-31 05:42:13 +02:00
changed regex for matching user mentions
This commit is contained in:
parent
7d504778b0
commit
1d3848424d
1 changed files with 2 additions and 2 deletions
|
@ -6,7 +6,7 @@ class FlavoredMarkdown < Redcarpet::Render::HTML
|
||||||
end
|
end
|
||||||
|
|
||||||
def wrap_mentions(text)
|
def wrap_mentions(text)
|
||||||
text.gsub! /(^|\s)(@\w+)/ do
|
text.gsub! /(^|\s)(@[a-zA-Z0-9_]{1,16})/ do
|
||||||
"#{$1}[#{$2}](#{show_user_profile_path $2.tr('@', '')})"
|
"#{$1}[#{$2}](#{show_user_profile_path $2.tr('@', '')})"
|
||||||
end
|
end
|
||||||
text
|
text
|
||||||
|
@ -23,4 +23,4 @@ class FlavoredMarkdown < Redcarpet::Render::HTML
|
||||||
def raw_html(raw_html)
|
def raw_html(raw_html)
|
||||||
Rack::Utils.escape_html raw_html
|
Rack::Utils.escape_html raw_html
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue