TopShelfCraft / Wordsmith

A plugin for Craft CMS to help you manage and manipulate text.
Other
30 stars 20 forks source link

New line created if first words are linked and second sentence in paragraph starts with the same words #44

Closed louderthan10 closed 3 years ago

louderthan10 commented 3 years ago

Okay, this is a really weird edge case and easy to fix from the content entry side, but want to report it for others that may hit this very strange bug.

If you start a new paragraph with a link, then start the second sentence with the exact same text as the link text, it breaks the first sentence after the link. Like this:

Screen Shot 2021-03-02 at 12 11 58 PM

If you change the first words of the second sentence, it no longer breaks:

Screen Shot 2021-03-02 at 12 12 16 PM

Grammatically, this probably shouldn't happen, but I figure I should flag it anyway.

🤷‍♂️

Details:

Text is being rendered with this tag:

{{ block.text|sc|parsedownExtra|smartypants }}

Craft version: 3.6.7 Wordsmith version: 3.3.0 Text inside Neo version: 2.9.0

michaelrog commented 3 years ago

I attempted to reproduce this with only Wordsmith filters, using your exact text...

{% set text %}
[Red flags](/resources/risk-management/red-flags) are not interchangeable with risks. Red flags are observable clues that may point to problems within a project. Risks are the many pathways again, both good and bad that a project may take.
{% endset %}

{{ text | parsedownExtra | smartypants }}

...and the output was as expected, without any erroneous breaks:

<p><a href="/resources/risk-management/red-flags">Red flags</a> are not interchangeable with risks. Red flags are observable clues that may point to problems within a project. Risks are the many pathways again, both good and bad that a project may take.</p>

My best guess is there's some wonky interaction with the sc filter here. Where does that come from / What functionality does it provide?