[ad_1]
Hey thanks for reporting. Interesting. Nothing comes to mind as to how that would happen. Can you help me debug?
What WP version and theme are you using? I’ll try to reproduce it. (I see u mentioned wp6.1 but I think that’s 6.0.1, right?)
Is it only preview or is it the same if you publish the page?
If you have a url you can share that would help. But keep in mind a url shared here cannot be deleted later.
- This reply was modified 6 hours, 39 minutes ago by Kevin Batdorf.
Thread Starter
xxjoxx
(@xxjoxx)
Hello,
0. You plugin’s design is amazing. I have come across it as I have been searching for a highlighter that can work with Stata syntax (which is not very popular in my domain, compared to R and Python). Code Block Pro is very intuitive.
1. I am not proficient in terms of CMS, HTML, and CSS. I might have done a mistake during the installation…something obvious. I will let you know if I identify it.
2. I am not sharing the link just yet (if it cannot be deleted later on) as I am still working on my website, re-shuffling.
3. I am using the WordPress Hueman theme:
4. Yes, you are right, that was a typo. I double-checked it and it is actually WordPress version 6.0.2 (I have automatic updates switched on) that I am using.
5. The plugin works perfectly in the post/page editor, however, when I switch to the website’s preview mode or publish, I can only see the raw code (no CSS styles etc.) surrounded with HTML tags, here, is an example:
`<span class=”line”><span style=”color: #D4D4D4″>> </span><span style=”color: #9CDCFE”>x</span></span>
<span class=”line”><span style=”color: #D4D4D4″>[</span><span style=”color: #B5CEA8″>1</span><span style=”color: #D4D4D4″>] </span><span style=”color: #B5CEA8″>5</span><span style=”color: #D4D4D4″> </span><span style=”color: #B5CEA8″>8</span><span style=”color: #D4D4D4″> </span><span style=”color: #B5CEA8″>3</span><span style=”color: #D4D4D4″> </span><span style=”color: #B5CEA8″>9</span><span style=”color: #D4D4D4″> </span><span style=”color: #B5CEA8″>2</span><span style=”color: #D4D4D4″> </span><span style=”color: #B5CEA8″>7</span><span style=”color: #D4D4D4″> </span><span style=”color: #B5CEA8″>4</span><span style=”color: #D4D4D4″> </span><span style=”color: #B5CEA8″>6</span><span style=”color: #D4D4D4″> </span><span style=”color: #B5CEA8″>10</span></span>
<span class=”line”><span style=”color: #D4D4D4″>> </span><span style=”color: #6A9955″># find the minimum</span></span>
<span class=”line”><span style=”color: #D4D4D4″>> </span><span style=”color: #DCDCAA”>min</span><span style=”color: #D4D4D4″>(</span><span style=”color: #9CDCFE”>x</span><span style=”color: #D4D4D4″>)</span></span>
<span class=”line”><span style=”color: #D4D4D4″>[</span><span style=”color: #B5CEA8″>1</span><span style=”color: #D4D4D4″>] </span><span style=”color: #B5CEA8″>2</span></span>
<span class=”line”><span style=”color: #D4D4D4″>> </span><span style=”color: #6A9955″># find the maximum</span></span>
<span class=”line”><span style=”color: #D4D4D4″>> </span><span style=”color: #DCDCAA”>max</span><span style=”color: #D4D4D4″>(</span><span style=”color: #9CDCFE”>x</span><span style=”color: #D4D4D4″>)</span></span>
<span class=”line”><span style=”color: #D4D4D4″>[</span><span style=”color: #B5CEA8″>1</span><span style=”color: #D4D4D4″>] </span><span style=”color: #B5CEA8″>10</span></span>
<span class=”line”><span style=”color: #D4D4D4″>> </span><span style=”color: #6A9955″># find the range</span></span>
<span class=”line”><span style=”color: #D4D4D4″>> </span><span style=”color: #DCDCAA”>range</span><span style=”color: #D4D4D4″>(</span><span style=”color: #9CDCFE”>x</span><span style=”color: #D4D4D4″>)</span></span>
<span class=”line”><span style=”color: #D4D4D4″>[</span><span style=”color: #B5CEA8″>1</span><span style=”color: #D4D4D4″>] </span><span style=”color: #B5CEA8″>2</span><span style=”color: #D4D4D4″> </span><span style=”color: #B5CEA8″>10</span></span>
The R code I tried to highlight:
> x
[1] 5 8 3 9 2 7 4 6 10
> # find the minimum
> min(x)
[1] 2
> # find the maximum
> max(x)
[1] 10
> # find the range
> range(x)
[1] 2 10
I’m thinking it’s the theme. Could you switch to a default WordPress theme like 2022 and try it out? At least to confirm.
If still no good, you may need to switch themes, go edit the page, make a small change, press update, then view the page. That way WP will repopulate the output.
Thread Starter
xxjoxx
(@xxjoxx)
I have tried it in 2022 theme, made a small change, updated…still the same outcome, only the background of the code block changed to the semi-transparent black. Maybe there is something in my WordPress settings. As soon as I figure it out, I will post the solution here 🙂
Thanks for following up. I wonder then if it’s another plugin that is causing it. Are you able to deactivate everything and try it?
What it seems like is happening is that something, somewhere, is escaping the markup at some point. Either when putting it into the database, or when attempting to render it. It could be a theme, or it could be a plugin.
It’s probably not WP or default WP theme as those are pretty consistent, although edge cases can occur, of course.
You could try disabling plugins, disabling themes, checking the database, and maybe try on a different WP install?
I put a temporary page with a Stata example here. (That example page likely will not be there if someone is reading this in the future. Ping me if you want a new one!)
Thread Starter
xxjoxx
(@xxjoxx)
Thank you SO MUCH!
I disabled Prismatic and SyntaxHighlighter Evolved plugins – it solved the problem.
I still cannot switch the background, but other than that, it works perfectly (including one-click copy button)! 🙂
Awesome! That’s good feedback too. I’ll add a fix for that background from Hueman theme. I noticed that background too when I installed it. Watch for an update in a bit!
