[wp-trac] [WordPress Trac] #13340: wpautop breaks inline MathMl

WordPress Trac noreply at wordpress.org
Wed Jul 24 17:40:22 UTC 2019


#13340: wpautop breaks inline MathMl
----------------------------+----------------------
 Reporter:  nicholaswilson  |       Owner:  (none)
     Type:  enhancement     |      Status:  closed
 Priority:  normal          |   Milestone:
Component:  Formatting      |     Version:  2.9.2
 Severity:  normal          |  Resolution:  wontfix
 Keywords:                  |     Focuses:
----------------------------+----------------------

Comment (by conner_bw):

 Chiming in with a me too.

 If I apply this patch it fixes the issue:

 https://core.trac.wordpress.org/attachment/ticket/13340/13340.diff

 For obvious reasons, I won't patch `wp-includes/formatting.php`,
 WordPress must do it...

 Or, let us filter those strings? Example:


 {{{#!php
 $allblocks = apply_filters( 'autop_allblocks',
 'table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary'
 );
 $allblocks = '(?:' . $allblocks . ')';

 // ... snip ...

 // Replace newlines that shouldn't be touched with a placeholder.
 $newline_preservation_helper = apply_filters(
 'autop_newline_preservation_helper', 'script|style' );
 $pee = preg_replace_callback( '/<(' . $newline_preservation_helper .
 ').*?<\/\\1>/s', '_autop_newline_preservation_helper', $pee );
 }}}

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


More information about the wp-trac mailing list