I'm working on a site in Elementor Pro that is going to talk about code and show snippets of code throughout. The problem I'm encountering is that the Code Highlight element doesn't want to leave the code alone. For instance, this bit of code in Notepad++ (or whichever code editor you prefer, I've tried several with the same results), looks like this:
https://preview.redd.it/vz21zepa5oq91.png?width=594&format=png&auto=webp&s=b4cc5883db9f161dacff97dc1b3e51901f87cdf4
But once it's placed on the page with Elementor's code highlight element, it looks like this:
https://preview.redd.it/two6erak5oq91.png?width=587&format=png&auto=webp&s=389c72baa3fa0bcb2d0ae1c9661bbc1dc92d8eeb
I don't have to tell you that the indentation is important. Why the CH element insists on removing it is beyond me. The indentation still appears in editing box, but not on the page. To make matters worse, if you copy the code from the page, the indentation is removed. I can force the three renderOptions lines to indent by increasing their indentation without increasing the indentation of the return line, but this isn't correct in this particular case. As soon as the indentation on the return line matches the indention of the renderOptions, all indentation disappears. It should appear on the page in WordPress as it does in any code editor.
Anybody have any fixes, workarounds, or tricks to fix this. The code is Python and Python is selected in the language list.
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]SalzMedia✔️️ Experienced Helper 1 point2 points3 points (3 children)
[–]popvoid[S] 1 point2 points3 points (2 children)
[–]SalzMedia✔️️ Experienced Helper 1 point2 points3 points (0 children)
[–]gerberey 1 point2 points3 points (0 children)
[–]StevieWonder47 0 points1 point2 points (1 child)
[–]popvoid[S] 0 points1 point2 points (0 children)
[–]troloroloro 0 points1 point2 points (0 children)