• Resolved alexynior

    (@alexynior)


    Hello,

    I have tried all the options and also disabled my cache plugin, but all the code is shown in one line. could you please help me?

    Best regards,

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    Please share the URL where the issue can be seen.

    Thread Starter alexynior

    (@alexynior)

    Plugin Author Weston Ruter

    (@westonruter)

    I can see the expected line breaks when I look at the HTML source:

    <pre class="wp-block-code" aria-describedby="shcb-language-7" data-shcb-language-name="HTML, XML" data-shcb-language-slug="xml"><div><code class="hljs language-xml"><span class="hljs-meta"><!DOCTYPE <span class="hljs-meta-keyword">html</span>></span>
    <span class="hljs-tag"><<span class="hljs-name">html</span>></span>
    <span class="hljs-tag"><<span class="hljs-name">h3</span>></span>Ejemplo de Botones Radio<span class="hljs-tag"></<span class="hljs-name">h3</span>></span>
    <span class="hljs-tag"><<span class="hljs-name">body</span>></span>
        <span class="hljs-tag"><<span class="hljs-name">form</span>></span>
            SELECCIONA GéNERO
            <span class="hljs-tag"><<span class="hljs-name">br</span>></span>
            <span class="hljs-tag"><<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"radio"</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"gender"</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"male"</span>></span>
            <span class="hljs-tag"><<span class="hljs-name">label</span> <span class="hljs-attr">for</span>=<span class="hljs-string">"male"</span>></span>Masculino<span class="hljs-tag"></<span class="hljs-name">label</span>></span><span class="hljs-tag"><<span class="hljs-name">br</span>></span>
            <span class="hljs-tag"><<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"radio"</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"gender"</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"female"</span>></span>
            <span class="hljs-tag"><<span class="hljs-name">label</span> <span class="hljs-attr">for</span>=<span class="hljs-string">"female"</span>></span>Femenino<span class="hljs-tag"></<span class="hljs-name">label</span>></span>
        <span class="hljs-tag"></<span class="hljs-name">form</span>></span>
    <span class="hljs-tag"></<span class="hljs-name">body</span>></span>
    <span class="hljs-tag"></<span class="hljs-name">html</span>></span></code></div><small class="shcb-language" id="shcb-language-7"><span class="shcb-language__label">Lenguaje del código:</span> <span class="shcb-language__name">HTML, XML</span> <span class="shcb-language__paren">(</span><span class="shcb-language__slug">xml</span><span class="shcb-language__paren">)</span></small></pre>

    The problem is this CSS style rule on your site:

    :not(pre)>code[class*=language-] {
        padding: .1em;
        border-radius: .3em;
        white-space: normal;
    }

    Specifically, the white-space: normal;. Where is that CSS coming from?

    You could fix it with CSS like the following:

    pre[data-shcb-language-slug]>div>code {
        white-space: pre;
    }
    Thread Starter alexynior

    (@alexynior)

    Oh, Thanks for the custom CSS. That solved the problem

    I’m very grateful ??

    Plugin Author Weston Ruter

    (@westonruter)

    What plugin is the source of the above code?

    Thread Starter alexynior

    (@alexynior)

    It is not a plugin. It must be the styles of the theme. I used to use “Code Editor and Compiler”, but I deactivated it to see if that was the problem, but it had nothing to do with it

    Plugin Author Weston Ruter

    (@westonruter)

    OK, thanks. I’ve filed an issue to make the plugin more resilient to such theme styles: https://github.com/westonruter/syntax-highlighting-code-block/issues/453

    Thread Starter alexynior

    (@alexynior)

    Perfect! thank you ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘No line breaks’ is closed to new replies.