wordpress-seo icon indicating copy to clipboard operation
wordpress-seo copied to clipboard

llms.txt escapes periods, exclamation marks, parentheses and more

Open jdevalk opened this issue 7 months ago • 1 comments

  • [x] I've read and understood the contribution guidelines.
  • [x] I've searched for any related issues and avoided creating a duplicate issue.

Please give us a description of what happened

To Reproduce

Step-by-step reproduction instructions

  1. Create a post with the title: Build websites like it’s 2005 (and win in 2025)
  2. See the output in llms.txt for this post, it's escaped: Build websites like it’s 2005 \(and win in 2025\)

Expected results

  1. Build websites like it’s 2005 (and win in 2025)

Actual results

  1. Build websites like it’s 2005 \(and win in 2025\)

jdevalk avatar Jun 11 '25 13:06 jdevalk

Hey @jdevalk ,

Thanks for reporting the issue. While doing the discovery for this initial release of the feature, we had to find out there's a lot of support in PHP and other languages for rendering markdown into HTML, but almost nothing preexisting for reliably escaping arbitrary content into safe markdown.

The problem is more complex than it seems at first, with a very vague initial standard and several popular extensions to it like GitHub-flavoured Markdown. For example, while the aprentheses above don't need escaping, some parentheses actually do depending on how and where they are being used.

So to keep things simple, we opted to go with safety over readability. The above is technically still correct markdown and will properly render with any of the popular markdown engines. We'll add more and more fine-tuning and edge case support in future releases that will produce a version that is not only correct, but also the most readable variation we can get away with.

All this to say: the above is already woking correctly, but we're aware it is not the prettiest way of writing this and will iterate on this in upcoming releases.

schlessera avatar Jun 13 '25 11:06 schlessera