Skip to content

Indentation changes rendering of <pre> #287

@Julow

Description

@Julow

The following code with indentation enabled renders a line break before the closing </pre>:

    <div><p>some doc ..............................</p>
     <pre><code><span>some code of just the right length ....</span></code>
     </pre><p>some more doc</p>

This adds an extra blank line to the pre element, which renders differently whether indentation is enabled or not.

open Tyxml.Html

let content =
  html
    (head (title (txt "example")) [])
    (body
       [
         div
           [
             div
               [
                 div
                   [
                     p [ txt "some doc .............................." ];
                     pre
                       [
                         code
                           [
                             span
                               [ txt "some code of just the right length ...." ];
                           ];
                       ];
                     p [ txt "some more doc" ];
                   ];
               ];
           ];
       ])

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