FIX: mentions broken after adding an <abbr> tag

A previous shortcut used was not allowing for <abbr and other tags starting with a

If <abbr> appeared anywhere in the text all mentions would fail to link
This commit is contained in:
Sam
2018-07-05 09:27:11 +10:00
parent d12194c438
commit b54ba4c952
2 changed files with 10 additions and 2 deletions

View File

@@ -204,6 +204,10 @@ describe PrettyText do
describe "Mentions" do
it "can handle mentions after abbr" do
expect(PrettyText.cook("test <abbr>test</abbr>\n\n@bob")).to eq("<p>test <abbr>test</abbr></p>\n<p><span class=\"mention\">@bob</span></p>")
end
it "should handle 3 mentions in a row" do
expect(PrettyText.cook('@hello @hello @hello')).to match_html "<p><span class=\"mention\">@hello</span> <span class=\"mention\">@hello</span> <span class=\"mention\">@hello</span></p>"
end