Skip to content

Indentation option might add an extra space #288

@Julow

Description

@Julow

The following code renders differently in the browser whether the indent option is enabled or not:

  <p>
   <span class="some padding ............................">some text here
    . and here
   </span>
  </p>

A line break is inserted between the two txt nodes. The extra breaks inside the p elements also change what C-A, C-C copies into the clipboard.

open Tyxml.Html

let content =
  html
    (head (title (txt "example")) [])
    (body
       [
         p
           [
             span
               ~a:[ a_class [ "some padding ............................" ] ]
               [ txt "some text here"; txt ". and here" ];
           ];
       ])

let () =
  Format.printf "%a" (pp ~indent:true ()) content

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions