Title: Single line code gets formatted differently
Last modified: November 25, 2019

---

# Single line code gets formatted differently

 *  Resolved [Navjot Singh](https://wordpress.org/support/users/navjotjsingh/)
 * (@navjotjsingh)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/single-line-code-gets-formatted-differently/)
 * Example: _[ redundant link removed, use the link field ]_
 * Single line code gets formatted differently (it picked my theme’s formatting)
   while multiple lines get formatted using Prism.
 * In the editor, there is no difference between how I entered the text. Both are
   written like
    `<pre><code class="language-bash"> the code in between </code></
   pre>` but the output is still different.
 * What to do?
    -  This topic was modified 6 years, 6 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
    -  This topic was modified 6 years, 6 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fsingle-line-code-gets-formatted-differently%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/single-line-code-gets-formatted-differently/#post-12173695)
 * Hi [@navjotjsingh](https://wordpress.org/support/users/navjotjsingh/), it looks
   like there may be an issue with Prism.js and single-line highlighting. The plugin
   basically only loads the required Prism.js scripts, so there is not a lot I can
   do for the actual script output/results. Best advice would be to ask the Prism.
   js support team for help. Here is the [Github page for Prism issues](https://github.com/PrismJS/prism/issues).
 * I hope this helps, let me know if I can provide any further infos.
 *  [Stef](https://wordpress.org/support/users/serafinnyc/)
 * (@serafinnyc)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/single-line-code-gets-formatted-differently/#post-12313767)
 * I think certain block editors, if not using Gutten, and even some themes strips
   the code formatting out. I struggled with it too Jeff and even after switching
   over to Highlight.js.
 * I know for myself I’m using Visual Composer and it’s stripping the
    `<php and
   the ?>` Out of the page, both admin side and content side.
 * Great plugin by the way.
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/single-line-code-gets-formatted-differently/#post-12313786)
 * Thanks Stef. For my own sites I disable all the block editor stuff and just use
   plain-text editor via my Disable Gutenberg plugin. That prevents interference
   and keeps the code display clean and proper. I know that’s not a possibility 
   for all sites, but I am mentioning here just FYI. Also if you happen to discover
   any further clues as to what might be removing the code formatting, please let
   me know. I am glad to do anything possible (from the plugin side of things) for
   compatibility, etc.
 *  [Stef](https://wordpress.org/support/users/serafinnyc/)
 * (@serafinnyc)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/single-line-code-gets-formatted-differently/#post-12315598)
 * Welcome. I think it’s TinyMCE that’s stripping some of it. Certain characters.
   Not positive but leaning that way for now.
 * I noticed that when I turn off TinyMCE
 * `add_filter( 'user_can_richedit' , '__return_false', 50 );`
 * Anything PHP plays nice. Turn it back on and it gets stripped. I’m also noticing
   that I can’t use Prism and can only use Highlight. Still trying to figure that
   one out when I have time.
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/single-line-code-gets-formatted-differently/#post-12317352)
 * Thanks for posting, [@serafinnyc](https://wordpress.org/support/users/serafinnyc/).
   Please keep me updated as to your findings.
 *  [Stef](https://wordpress.org/support/users/serafinnyc/)
 * (@serafinnyc)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/single-line-code-gets-formatted-differently/#post-12328657)
 * I’ve tracked it down to Visual Composer. However, I can use the Gutenberg Editor
   that I have inside VC and it won’t strip anything. That’s just too many steps
   to add code.
 * I think I may write a module that gets added to VC that’s only for source code.
   Not sure yet.
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/single-line-code-gets-formatted-differently/#post-12329117)
 * Very interesting. If there is anything that can be added via Prismatic side of
   things, let me know.
 *  [Stef](https://wordpress.org/support/users/serafinnyc/)
 * (@serafinnyc)
 * [6 years, 4 months ago](https://wordpress.org/support/topic/single-line-code-gets-formatted-differently/#post-12329398)
 * I will. For now I turned off VC inside Posts. It appears to work perfectly now.
   Something in VC is stripping the source code when you use:
 * `->`

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

The topic ‘Single line code gets formatted differently’ is closed to new replies.

 * ![](https://ps.w.org/prismatic/assets/icon-256x256.png?rev=1521267)
 * [Prismatic](https://wordpress.org/plugins/prismatic/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/prismatic/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/prismatic/)
 * [Active Topics](https://wordpress.org/support/plugin/prismatic/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/prismatic/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/prismatic/reviews/)

 * 8 replies
 * 3 participants
 * Last reply from: [Stef](https://wordpress.org/support/users/serafinnyc/)
 * Last activity: [6 years, 4 months ago](https://wordpress.org/support/topic/single-line-code-gets-formatted-differently/#post-12329398)
 * Status: resolved