Yes you can enable code escaping option, located on whichever tab (Prism, Highlight, Plain) you have enabled in the plugin settings.
Already done that. How do I prevent Prismatic changing my code to ascii string?
Ref: screenshot https://i0.wp.com/i.imgur.com/GyCXNw9.jpg?ssl=1
I’m not sure. It does not happen on default WP with the code escape option enabled. So it sounds like something is interfering with normal functionality. Are you familiar with troubleshooting plugins, theme, etc.?
I got why my code was changing. I had Code Escaping enabled for Frontend and Admin area.
This is how I solved
As I disabled it, code started appearing as expected. I was confused with term Code Escaping thought it is enable/disable.
Now, there is only one issue.
I am using Prism library with Line number enabled but it doesn’t show at frontend. Are you aware of this issue?
Thanks
Line numbers are working fine on default WP install, for example after enable in the Prism settings, any code block will have line numbers by adding the classes language-php line-numbers to the pre tag.
If that is not working, then something is interfering with normal functionality.
-
This reply was modified 6 years, 2 months ago by
Jeff Starr. Reason: code formatting issues
You can verify on default WP running the default theme/plugins.
I tried on fresh WordPress.
This video shows my complete steps https://youtu.be/LuG4PlSo5KM
URL in question: https://wordpress-315148-1199852.cloudwaysapps.com/some-php-code/
-
This reply was modified 6 years, 2 months ago by
Gulshan Kumar. Reason: added URL for reference
Thanks for the video. It looks like you have not added the line-numbers class. You can check by clicking the block options and then “Edit as HTML”. The markup will then show, where you can see which classes are added to the pre tag. So you can add the line-numbers class directly by editing the HTML, or you can add by clicking Advanced in the block editor sidebar, under “Additional CSS Class(es)”.
Adding class works. Can you please automate this process if Line Number is enabled in plugin? It would save the hassle of adding a class all the time manually.
Thanks
Yes, it is a good idea. I have added to the to-do list. May not make in the next/upcoming version (which already is wrapping up), but definitely at some point will add this feature. Thanks.