Re: RFE: Indentation of HTML

Leif Halvard Silli <[email protected]> Sat, 12 Jul 2025 20:03:04 +0200
Newsgroups gmane.editors.xxe.general
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============6950981022085695895==
Content-Type: multipart/alternative;
 boundary="------------mj1ey08wpCcb7o7TXWnD04Nu"
Content-Language: nn-NO

This is a multi-part message in MIME format.
--------------mj1ey08wpCcb7o7TXWnD04Nu
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

On 11.07.2025 22:51 by Leif Halvard Silli:

> The WYSIWYG editing interface behaves as if the space characters in 
> the following code example are signficant!
>
> <body><space><p>Lorem.</p><space><Ipsum></p><space></body>
>
> Or else it would not have displayed those space characters as an empty 
> lines – empty paragraphs – over, between or after the <p> elements.

For the record, the statement «over, between or after the <p> elements» 
is 66% incorrect. (I literally used <body xml:space="preserve"> when I 
wrote that ... sorry.)

Let me try again – currently, for the following HTML code:

<body><p>Lorem.</p><p>Ipsum</p></body>

Then, XXE will massage the whitespace to a single space character:

<body><p>Lorem.</p><p>Ipsum.</p></body>(Thus, the whitespace just after 
<body> and just before </body> will be removed.) I still find this 
brittle, though. -- Leif Halvard Silli

--------------mj1ey08wpCcb7o7TXWnD04Nu
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>On 11.07.2025 22:51 by Leif Halvard Silli:</p>
    <blockquote type="cite"
      cite="mid:[email protected]">The
      WYSIWYG editing interface behaves as if the space characters in
      the following code example are signficant!
      <br>
      <br>
&lt;body&gt;&lt;space&gt;&lt;p&gt;Lorem.&lt;/p&gt;&lt;space&gt;&lt;Ipsum&gt;&lt;/p&gt;&lt;space&gt;&lt;/body&gt;
      <br>
      <br>
      Or else it would not have displayed those space characters as an
      empty lines – empty paragraphs – over, between or after the
      &lt;p&gt; elements.</blockquote>
    <p>For the record, the statement «over, between or after the
      &lt;p&gt; elements» is 66% incorrect. (I literally used &lt;body
      xml:space="preserve"&gt; when I wrote that ... sorry.)<br>
    </p>
    <p>Let me try again – currently, for the following HTML code:<br>
    </p>
    <pre style="font-family: 'Monospaced', courier; background: #ffffff"><span
    style="font-weight: bold;color: #808080;">&lt;</span><span
    style="font-weight: bold;color: #8b008b;">body</span><span
    style="font-weight: bold;color: #808080;">&gt;</span><span
    style="color: #808080;">    </span><span
    style="font-weight: bold;color: #808080;">&lt;</span><span
    style="font-weight: bold;color: #8b008b;">p</span><span
    style="font-weight: bold;color: #808080;">&gt;</span><span
    style="color: #000000;">Lorem.</span><span
    style="font-weight: bold;color: #808080;">&lt;/</span><span
    style="font-weight: bold;color: #8b008b;">p</span><span
    style="font-weight: bold;color: #808080;">&gt;</span><span
    style="color: #808080;">    </span><span
    style="font-weight: bold;color: #808080;">&lt;</span><span
    style="font-weight: bold;color: #8b008b;">p</span><span
    style="font-weight: bold;color: #808080;">&gt;</span><span
    style="color: #000000;">Ipsum</span><span style="color: #808080;"> </span><span
    style="font-weight: bold;color: #808080;">&lt;/</span><span
    style="font-weight: bold;color: #8b008b;">p</span><span
    style="font-weight: bold;color: #808080;">&gt;</span><span
    style="color: #808080;"> </span><span
    style="font-weight: bold;color: #808080;">&lt;/</span><span
    style="font-weight: bold;color: #8b008b;">body</span><span
    style="font-weight: bold;color: #808080;">&gt;</span>
<span style="font-weight: bold;color: #808080;"></span></pre>
    <p></p>
    <p>Then, XXE will massage the whitespace to a single space
      character:<br>
    </p>
    <pre style="font-family: 'Monospaced', courier; background: #ffffff"><span
    style="font-weight: bold;color: #808080;">&lt;</span><span
    style="font-weight: bold;color: #8b008b;">body</span><span
    style="font-weight: bold;color: #808080;">&gt;</span><span
    style="font-weight: bold;color: #808080;">&lt;</span><span
    style="font-weight: bold;color: #8b008b;">p</span><span
    style="font-weight: bold;color: #808080;">&gt;</span><span
    style="color: #000000;">Lorem.</span><span
    style="font-weight: bold;color: #808080;">&lt;/</span><span
    style="font-weight: bold;color: #8b008b;">p</span><span
    style="font-weight: bold;color: #808080;">&gt;</span><span
    style="color: #808080;"> </span><span
    style="font-weight: bold;color: #808080;">&lt;</span><span
    style="font-weight: bold;color: #8b008b;">p</span><span
    style="font-weight: bold;color: #808080;">&gt;</span><span
    style="color: #000000;">Ipsum.</span><span
    style="font-weight: bold;color: #808080;">&lt;/</span><span
    style="font-weight: bold;color: #8b008b;">p</span><span
    style="font-weight: bold;color: #808080;">&gt;</span><span
    style="font-weight: bold;color: #808080;">&lt;/</span><span
    style="font-weight: bold;color: #8b008b;">body</span><span
    style="font-weight: bold;color: #808080;">&gt;</span><span
    style="color: rgb(128, 128, 128);">

(Thus, the whitespace just after &lt;body&gt; and just before &lt;/body&gt; will be removed.)

I still find this brittle, though.
-- 
Leif Halvard Silli
</span><span style="font-weight: bold;color: #808080;"></span></pre>
    <p></p>
  </body>
</html>

--------------mj1ey08wpCcb7o7TXWnD04Nu--

--===============6950981022085695895==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

--===============6950981022085695895==--