[wp-trac] [WordPress Trac] #57381: Filter wptexturize brokes tailwindcss brackets

WordPress Trac noreply at wordpress.org
Fri Dec 23 12:36:11 UTC 2022


#57381: Filter wptexturize brokes tailwindcss brackets
--------------------------+-----------------------------
 Reporter:  ArtZ91        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Formatting    |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Hi there. I am developing WordPress Theme with TailwindCss frontend and
 gutenberg blocks.

 My gutenberg block HTML was partially broken by `wptexturize` filter of
 `the_content` function.

 Affected code:

 {{{
 <div class="swiper [&>.swiper-pagination]:static">...</div>
 }}}

 Result:

 {{{
 <div class="swiper [&>.swiper-pagination]:static»>...</div>
 }}}

 TailwindCss docs: https://tailwindcss.com/docs/hover-focus-and-other-
 states#using-arbitrary-variants

 My current solution is remove this filter before calling the_content for
 my gutenberg page template:
 {{{
 <?php
 $content = get_post_field( 'post_content', get_the_ID() );
 remove_filter('the_content', 'wptexturize');
 the_content();
 ?>
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57381>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list