[wp-trac] [WordPress Trac] #56294: WordPress search finds block name in comment

WordPress Trac noreply at wordpress.org
Mon Apr 3 13:25:29 UTC 2023


#56294: WordPress search finds block name in comment
--------------------------------------+------------------------------
 Reporter:  zodiac1978                |       Owner:  (none)
     Type:  enhancement               |      Status:  closed
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Database                  |     Version:  5.0
 Severity:  normal                    |  Resolution:  maybelater
 Keywords:  needs-patch dev-feedback  |     Focuses:  performance
--------------------------------------+------------------------------

Comment (by zodiac1978):

 My code ''is'' working, but the problem is, that WordPress is adding more
 markup with classes, like `<pre class="wp-block-syntaxhighlighter-code">`
 or `<figure class="wp-block-gallery has-nested-images columns-default is-
 cropped">` why the search is still finding those posts/pages.

 Thanks to @l1nuxjedi for helping me with some testing in MariaDB.

 So the approach from @espiat to remove the class names is a good idea, but
 I think it needs some more refinement. At the moment, ''everything'' in
 quotes from the content is filtered out.

 Maybe we can limit this to just in "<" and ">"?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56294#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list