Is it possible to cut off delayed code on a web page in the same way as in the code editor? See the screenshot below for a better understanding of what I mean:
pre-wrap
on the Web page:
Indented line wrapping in code editor:
What I mean is that line indents support indentation even after packaging. This does not seem to happen on web pages. Is there a CSS property that does this? (JavaScript will be fine too.)
NOTE. I am not talking about dedicated code. This is about embedding wrapped lines.
If that matters, this is how I show code blocks on my web pages:
<pre><code>if ( is_page() && $post->post_parent ) { return $post->post_parent; } else { return false; } </code></pre>
... and white-space: pre-wrap;
style white-space: pre-wrap;
applies to the pre
tag.
source share