Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐞 Journal: Entry with overlapping Keywords ignore the longer Keyword #1714

Closed
Tracked by #5
zspencer opened this issue Jul 27, 2023 · 1 comment
Closed
Tracked by #5
Labels
🐞 bug Something isn't working

Comments

@zspencer
Copy link
Member

zspencer commented Jul 27, 2023

For https://slipvector.games, I noticed that one of the worldbuilding notes was not correctly extracting keywords.

\#SarinsGarden is a large #WorldGarden on the planet #Sarin in the #DarnikSystem. 
Screenshot 2023-07-27 at 1 52 26 PM

I would expect #SarinsGarden to be it's own keyword.

@zspencer zspencer added the 🐞 bug Something isn't working label Jul 27, 2023
@zspencer zspencer changed the title Journal: Entry with overlapping Keywords have ignore the longer keyword 🐞 Journal: Entry with overlapping Keywords have ignore the longer keyword Jul 27, 2023
@zspencer zspencer changed the title 🐞 Journal: Entry with overlapping Keywords have ignore the longer keyword 🐞 Journal: Entry with overlapping Keywords ignore the longer Keyword Jul 27, 2023
zspencer added a commit that referenced this issue Jul 27, 2023
- #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.
zspencer added a commit that referenced this issue Jul 28, 2023
* 🐞🔨 `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.

* 🥗 `Entry`: Cover rendering a `Keyword` with aliases

I noticed I had dropped the `reverse` in the `keywords_regex` method,
and thought... "hmm, that may not be a great thing..."

So I went to write some test cases that would force the reverse to be
put back in; which meant I needed a keyword with aliases...

* 🥗 `Journal`: Assert `Entry` links to `@[email protected]` work
@zspencer
Copy link
Member Author

zspencer commented Jul 28, 2023

SO MUCH BETTER!
Screenshot 2023-07-28 at 1 30 01 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant