Title: additonal CSS class, again
Last modified: April 18, 2020

---

# additonal CSS class, again

 *  Resolved [rgfactory](https://wordpress.org/support/users/rgfactory/)
 * (@rgfactory)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/additonal-css-class-again/)
 * Hi Thomas,
 * I have the [same problem](https://wordpress.org/support/topic/additional-css-class-2/)(
   I can’t reply to this resolved issue), if I add an additional css class to a 
   Katex block, it breaks the block rendering in the post edition page.
 * Example : I add the class named “**rgf-test**” to the block, then after saving
   my post and reloading the page, I have the following message in the JS console:
 *     ```
       Block validation: Expected attribute "class" of value "wp-block-katex-display-block katex-eq", saw "wp-block-katex-display-block katex-eq rgf-test
       Block validation: Block validation failed for "katex/display-block"
       ```
   
 * Wordpress => 5.4
    katex plugin version => 2.0.2 theme => twenty-eleven => 3.4
 * I hope you’re doing well.
 * Thank you very much.
 * RG Factory.
 * PS : you can push the fix in development version if it’s more convenient, I will
   test it, just tell me.
    -  This topic was modified 6 years, 1 month ago by [rgfactory](https://wordpress.org/support/users/rgfactory/).
    -  This topic was modified 6 years, 1 month ago by [rgfactory](https://wordpress.org/support/users/rgfactory/).
    -  This topic was modified 6 years, 1 month ago by [rgfactory](https://wordpress.org/support/users/rgfactory/).

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Author [Tom Churchman](https://wordpress.org/support/users/beskhue/)
 * (@beskhue)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/additonal-css-class-again/#post-12697530)
 * Hi RG Factory,
 * I’ve not been able to reproduce this issue.
 * Does this (also) occur when creating a completely new post?
 * Could you share the post’s code? In the editor, press the three vertical dots
   in the top right, and select “code editor”.
 *  Thread Starter [rgfactory](https://wordpress.org/support/users/rgfactory/)
 * (@rgfactory)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/additonal-css-class-again/#post-12700015)
 * Hi Thomas,
 * yes it happens when creating a completely new post.
 * This is the post’s code :
 *     ```
       <!-- wp:paragraph -->
       <p>this is a test </p>
       <!-- /wp:paragraph -->
   
       <!-- wp:katex/display-block -->
       <div class="wp-block-katex-display-block katex-eq rgf-test" data-katex-display="true">\overrightarrow{OB} \begin{cases} x = v_0.\cos(\alpha).t
       \\ y = -\dfrac{1}{2}.g.t^2 + v_0.\sin(\alpha).t + h
       \end{cases}</div>
       <!-- /wp:katex/display-block -->
       ```
   
 *  Plugin Author [Tom Churchman](https://wordpress.org/support/users/beskhue/)
 * (@beskhue)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/additonal-css-class-again/#post-12700150)
 * I unfortunately am still not able to reproduce this issue with the same versions
   of WordPress, this plugin, and the theme Twenty Eleven. The additional class 
   is added as expected.
 * However, the code your shared is immediately changed by WordPress to:
 *     ```
       <!-- wp:paragraph -->
       <p>this is a test </p>
       <!-- /wp:paragraph -->
   
       <!-- wp:katex/display-block {"className":"rgf-test"} -->
       <div class="wp-block-katex-display-block katex-eq rgf-test" data-katex-display="true">\overrightarrow{OB} \begin{cases} x = v_0.\cos(\alpha).t
       \\ y = -\dfrac{1}{2}.g.t^2 + v_0.\sin(\alpha).t + h
       \end{cases}</div>
       <!-- /wp:katex/display-block -->
       ```
   
 * Note the addition of `{"className":"rgf-test"}`. Could you try whether this code
   does render inside the block editor?
 *  Thread Starter [rgfactory](https://wordpress.org/support/users/rgfactory/)
 * (@rgfactory)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/additonal-css-class-again/#post-12700569)
 * Thomas,
 * I tried your code with the className, but when I save the post the code is replaced
   by the one without the classname…
 * But I figured out what is the problem (kind of…) : the wordpress framework [Bedrock](https://roots.io/docs/bedrock/master/installation/#getting-started)
 * Yeah, I forgot to say this, I use the framework [Bedrock](https://roots.io/bedrock/).
 * So here is what I did :
    Fresh install **without Bedrock**, your plugin **works
   like a charm**, you are right. Fresh install **with Bedrock**, **this css custom
   class bug appear**s.
 * I am a new user of Bedrock, so it will be difficult for me to find the origin
   of the bug…
 * So for now I’am gonna use the classic WordPress, without Bedrock, it is not a
   problem at all.
 * What do I do ? I mark as resolved, or do you wanna try to fix this Bedrock bug?
 * Thank you again Thomas.
 *  Plugin Author [Tom Churchman](https://wordpress.org/support/users/beskhue/)
 * (@beskhue)
 * [6 years ago](https://wordpress.org/support/topic/additonal-css-class-again/#post-12703883)
 * I was able to reproduce the issue on Bedrock. I am not sure why the issue occurs
   on Bedrock and not on a “normal” WordPress install.
 * Regardless, I believe I’ve fixed the issue. The fix is available in the development
   version: [https://wordpress.org/plugins/katex/advanced/](https://wordpress.org/plugins/katex/advanced/)
 * Please test it and let me know whether it works for you.
 *  Thread Starter [rgfactory](https://wordpress.org/support/users/rgfactory/)
 * (@rgfactory)
 * [6 years ago](https://wordpress.org/support/topic/additonal-css-class-again/#post-12712517)
 * Hello Thomas,
 * I tried with the development version (2.0.3) but it does not work on a fresh 
   install of bedrock.
 * The css custom class bug is still there.
 *  Plugin Author [Tom Churchman](https://wordpress.org/support/users/beskhue/)
 * (@beskhue)
 * [6 years ago](https://wordpress.org/support/topic/additonal-css-class-again/#post-12713137)
 * Hi RG Factory,
 * I made a mistake with the previous development version. Could you download the
   new development version and try again?
    -  This reply was modified 6 years ago by [Tom Churchman](https://wordpress.org/support/users/beskhue/).
 *  Thread Starter [rgfactory](https://wordpress.org/support/users/rgfactory/)
 * (@rgfactory)
 * [6 years ago](https://wordpress.org/support/topic/additonal-css-class-again/#post-12713629)
 * It works !
 * Thank you very much.
 * Did you figured out why this error only appeared in Bedrock ?
 *  Plugin Author [Tom Churchman](https://wordpress.org/support/users/beskhue/)
 * (@beskhue)
 * [6 years ago](https://wordpress.org/support/topic/additonal-css-class-again/#post-12713892)
 * Thank you for the confirmation!
 * I have not found out why it broke specifically for Bedrock. Bedrock uses the 
   exact same WordPress 5.4 code as a “normal” install, so it probably has something
   to do with the WordPress configuration.
 * I was able to ascertain the issue was caused by a Bedrock installation requiring`
   className` to be explicitly mentioned as an attribute on the KaTeX block, whereas
   in a “normal” install it was not required (and, I believed, that was how it was
   intended).
 * I’ve not been able to tell what the specific difference between Bedrock and a
   normal install is that made this issue crop up, though.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘additonal CSS class, again’ is closed to new replies.

 * ![](https://ps.w.org/katex/assets/icon.svg?rev=1993573)
 * [KaTeX](https://wordpress.org/plugins/katex/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/katex/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/katex/)
 * [Active Topics](https://wordpress.org/support/plugin/katex/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/katex/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/katex/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [Tom Churchman](https://wordpress.org/support/users/beskhue/)
 * Last activity: [6 years ago](https://wordpress.org/support/topic/additonal-css-class-again/#post-12713892)
 * Status: resolved