Closed rodrigo-arias closed 4 months ago
Hey @rodrigo-arias overall things look good and it makes sense. One question I have is if there's need to cover the closing tags as well: </td>
and </th>
or if the changes you provide cover those cases enough.
Didn't mean to switch them. I meant more handling all 4. :)
Hey @tw2113 adding a space in the closing tags as well would generate double spaces (end of one cell and opening of the next). However, your comment led me to update the code to replace the closing tags, this has two advantages:
Before
After
Duly noted on those change reasons.
Overall I approve of this, but we need to figure out a next release plan, so I'm not merging just yet.
I'm wondering if it'd maybe be better put in this spot: https://github.com/WebDevStudios/wp-search-with-algolia/blob/2.7.1/includes/class-algolia-utils.php#L199-L203
You'd be doing the exact same thing, essentially in the exact same process, except in one method call earlier, and it'd match up better with other similar code.
No rush, I'm not actually using the plugin, I noticed it in my fork and wanted to contribute in case it was useful to someone else. Thank you.
This PR prevents the contents of table blocks from being concatenated by making them unsearchable. A space is added after the cell tags so that they remain independent words after applying
wp_strip_all_tags
.Before![CleanShot 2024-02-20 at 15 49 55](https://github.com/WebDevStudios/wp-search-with-algolia/assets/11416255/bdc932db-8314-4df0-bfc8-1d150c9be308)
After![CleanShot 2024-02-20 at 15 50 43](https://github.com/WebDevStudios/wp-search-with-algolia/assets/11416255/c9847304-8b95-4628-81a2-cac235ac0794)