-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ππ¨
Journal
: Entry
body supports multiple overlapping Keywords
- #1714 Turns out, it was a renderer-layer thing; where the shorter `Keyword` was getting linkfied prior to the longer `Keyword`, and when I switched to linkify the longer `Keyword` first it would double-down on the links putting a link to the shorter keyword within the longer one! So now I'm matching the `#` as part of the `Keyword`, and replacing it with the html entity for `#`, (aka `#`) This makes it so when we linkify keywords long-to-short; the longer keywords no longer contain the shorter keyword; eliminating the nested `a` tags.
- Loading branch information
Showing
4 changed files
with
32 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,10 @@ | |
subject(:output) { render_inline(component) } | ||
|
||
let(:component) { described_class.new(entry: entry) } | ||
let(:entry) { create(:journal_entry, body: "https://www.google.com @[email protected] #GoodTimes") } | ||
let(:entry) { create(:journal_entry, body: "https://www.google.com @[email protected] #GoodTimes with the #GoodTimesBand") } | ||
|
||
it { is_expected.to have_link("https://www.google.com", href: "https://www.google.com") } | ||
it { is_expected.to have_link("#GoodTimes", href: polymorphic_path(entry.journal.keywords.find_by(canonical_keyword: "GoodTimes").location)) } | ||
|
||
it { is_expected.to have_link("#GoodTimesBand", href: polymorphic_path(entry.journal.keywords.find_by(canonical_keyword: "GoodTimesBand").location)) } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters