From 415606a4d027e42383c56de00fb04dd7e490fb8b Mon Sep 17 00:00:00 2001 From: Zee Spencer <50284+zspencer@users.noreply.github.com> Date: Sun, 9 Jul 2023 21:16:51 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=A5=94=E2=9C=A8=20`Journal`:=20`Entry`=20?= =?UTF-8?q?links=20to=20their=20`Terms`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - https://github.com/zinc-collective/convene/issues/1566 --- app/furniture/journal/renderer.rb | 4 +++- spec/furniture/journal/entry_spec.rb | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/furniture/journal/renderer.rb b/app/furniture/journal/renderer.rb index 8ac0d8888..85b3d9400 100644 --- a/app/furniture/journal/renderer.rb +++ b/app/furniture/journal/renderer.rb @@ -6,7 +6,9 @@ def autolink(link, link_type) end def postprocess(doc) - doc.gsub(/@([a-zA-Z\d]*)@(.*\.[a-zA-Z]*)/, '@\1@\2') + doc + .gsub(/@([a-zA-Z\d]*)@(.*\.[a-zA-Z]*)/, '@\1@\2') + .gsub(/#(\w+)/, '#\1') end end end diff --git a/spec/furniture/journal/entry_spec.rb b/spec/furniture/journal/entry_spec.rb index f8ee56790..ab513ba6f 100644 --- a/spec/furniture/journal/entry_spec.rb +++ b/spec/furniture/journal/entry_spec.rb @@ -13,10 +13,11 @@ describe "#to_html" do subject(:to_html) { entry.to_html } - context "when #body is 'https://www.google.com @zee@weirder.earth'" do - let(:entry) { build(:journal_entry, body: "https://www.google.com @zee@weirder.earth") } + context "when #body is 'https://www.google.com @zee@weirder.earth #GoodTimes'" do + let(:entry) { build(:journal_entry, body: "https://www.google.com @zee@weirder.earth #GoodTimes") } it { is_expected.to include('https://www.google.com') } + it { is_expected.to include('#GoodTimes') } end end