awesomemotive / all-in-one-seo-pack

All in One SEO plugin for WordPress SEO
https://aioseo.com
339 stars 155 forks source link

Improve regex pattern to remove new lines #3064

Closed arnaudbroes closed 4 years ago

arnaudbroes commented 4 years ago

Issue #3023

Proposed changes

This improves the regex pattern to remove new lines.

Types of changes

Checklist

Testing instructions

  1. Reproduce the original issue as seen here- https://github.com/semperfiwebdesign/all-in-one-seo-pack/issues/3023#issuecomment-558285178. You'll want to add at least 2 paragraphs into the Classic Editor block.
  2. Install this PR and see if it fixes it.

Further comments

@wpsmort this was rather hard to troubleshoot but I believe the regex pattern wasn't able to filter the new lines that the Classic Editor block uses.

Also during test, note that the Preview Snippet will only update after you unfocus/leave the Classic Editor block and click anywhere else. This behaviour is normal and expected.

wpsmort commented 4 years ago

This is tested and is good.