diff --git a/lib/pretty_text.rb b/lib/pretty_text.rb
index 5a109024085..81a9e768df8 100644
--- a/lib/pretty_text.rb
+++ b/lib/pretty_text.rb
@@ -333,7 +333,7 @@ module PrettyText
# extract quotes
doc.css("aside.quote[data-topic]").each do |aside|
if aside["data-topic"].present?
- url = +"/t/topic/#{aside["data-topic"]}"
+ url = +"/t/#{aside["data-topic"]}"
url << "/#{aside["data-post"]}" if aside["data-post"].present?
links << DetectedLink.new(url, true)
end
diff --git a/spec/components/pretty_text_spec.rb b/spec/components/pretty_text_spec.rb
index 2cf7d81fb36..67722c127dd 100644
--- a/spec/components/pretty_text_spec.rb
+++ b/spec/components/pretty_text_spec.rb
@@ -706,7 +706,7 @@ describe PrettyText do
end
it "should extract links to topics" do
- expect(extract_urls("")).to eq(["/t/topic/321"])
+ expect(extract_urls("")).to eq(["/t/321"])
end
it "should lazyYT videos" do
@@ -714,7 +714,7 @@ describe PrettyText do
end
it "should extract links to posts" do
- expect(extract_urls("")).to eq(["/t/topic/1234/4567"])
+ expect(extract_urls("")).to eq(["/t/1234/4567"])
end
it "should not extract links to anchors" do
@@ -734,7 +734,7 @@ describe PrettyText do
expect(links.map { |l| [l.url, l.is_quote] }.sort).to eq([
["http://body_only.com", false],
["http://body_and_quote.com", false],
- ["/t/topic/1234", true],
+ ["/t/1234", true],
].sort)
end