Untuk inline biasa <code>
digunakan:
<code>...</code>
dan untuk masing-masing dan setiap tempat di mana diblokir <code>
perlu digunakan
<code style="display:block; white-space:pre-wrap">...</code>
Atau, tentukan <codenza>
tag untuk blok break lining <code>
(tidak ada kelas)
<script>
</script>
<style>
codenza, code {} /* noop mnemonic aide that codenza mimes code tag */
codenza {display:block;white-space:pre-wrap}
</style>`
Pengujian: (NB: berikut ini adalah scURIple yang menggunakan data:
protokol / skema URI, oleh karena itu %0A
kode format nl sangat penting untuk menjaga seperti ketika dipotong dan disisipkan ke dalam bilah URL untuk pengujian - jadi view-source:
( ctrl- U) terlihat bagus sebelum setiap baris di bawah ini dengan %0A
)
data:text/html;charset=utf-8,<html >
<script>document.write(window.navigator.userAgent)</script>
<script></script>
<style>
codenza, code {} /* noop mnemonic aide that codenza mimes code tag */
codenza {display:block;white-space:pre-wrap}
</style>
<p>First using the usual <code> tag
<code>
%0A function x(arghhh){
%0A return "a very long line of text that will extend the code beyond the boundaries of the margins, guaranteed for the most part, well maybe without you as a warrantee (except in abnormally conditioned perverse environs in which case a warranty is useless)"
%0A }
</code>
and then
<p>with the tag blocked using pre-wrapped lines
<code style=display:block;white-space:pre-wrap>
%0A function x(arghhh){
%0A return "a very long line of text that will extend the code beyond the boundaries of the margins, guaranteed for the most part, well maybe without you as a warrantee (except in abnormally conditioned perverse environs in which case a warranty is useless)"
%0A }
</code>
<br>using an ersatz tag
<codenza>
%0A function x(arghhh){
%0A return "a very long line of text that will extend the code beyond the boundaries of the margins, guaranteed for the most part, well maybe without you as a warrantee (except in abnormally conditioned perverse environs in which case a warranty is useless)"
%0A }
</codenza>
</html>