Para <code>
uso normal en línea :
<code>...</code>
y para todos y cada uno de los lugares donde <code>
se necesita bloquear
<code style="display:block; white-space:pre-wrap">...</code>
Alternativamente, defina una <codenza>
etiqueta para el bloque de revestimiento de ruptura <code>
(sin clases)
<script>
</script>
<style>
codenza, code {} /* noop mnemonic aide that codenza mimes code tag */
codenza {display:block;white-space:pre-wrap}
</style>`
Pruebas: (NB: el siguiente es un SCURIple que utiliza un data:
protocolo / esquema URI, por lo tanto, los %0A
códigos de formato nl son esenciales para preservarlos cuando se cortan y pegan en la barra de URL para la prueba, por lo que view-source:
( ctrl- U) se ve bien antes de cada línea a continuación %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>