Hi @wordruman,
It seems like there are some alignment issues in the screenshot. In the screenshot you provided, the lines 6-7 and 11-12 really should be on individual lines.
I copied your code snippet and tested it on my test site, and had thirteen exact lines without any text wrapping. I am on WordPress 5.8.2 running Twenty Nineteen theme. I’m using block editor, and added the snippet using a Syntax Highlighter code block, and specified Java as the language.
You can see the example here:
https://alexmillspluginstest.mystagingwebsite.com/testing-syntax-highlighter/
Since I couldn’t replicate the issue, I suspect that there may be a site-specific setup that’s causing the issues. Can you kindly share with us the exact steps you took to embed the code snippet? Are you using a classic editor or a block editor? Are you using a default WordPress theme?
Please share screenshots of your Syntax Highlighter Settings as well so we can copy it and see if we can replicate this issue (under WP-Admin > Settings > SyntaxHighlighter).
Please note, there may be something else installed on the site that’s causing problems. The quickest way to figure out if something is interfering is to test for a theme or plugin conflict.
I know it’s less than ideal, but could you please try the following:
– Temporarily deactivate all the site’s plugins except for Syntax Highlighter and clear your browser’s cache.
– Then test the code snippet again. If the issue resolves, then we’ll know that another plugin is conflicting here. You can re-enable your plugins one by one, in between, until you find the one causing the conflict. You can leave it disabled or reach out to the plugin developer for a fix.
If disabling plugins doesn’t help, it may be the theme.
– Temporarily switch your theme to a WordPress default theme like Twenty Twenty. Then try Syntax Highlighter code snippet again. If the issue resolves, then you know it’s a problem with the theme, and you can reach out to the theme developer for a fix.
Let us know how that goes.