-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Indentation changes rendering of <pre> #287
Comments
I have an other example where the open Tyxml.Html
let content =
html
(head (title (txt "example")) [])
(body
[
div
[
h2 [ txt "example" ];
pre
[
code
[
txt
(List.init 20 (fun _ -> "a lot of code")
|> String.concat "\n");
];
];
];
])
let () =
Format.printf "%a" (pp ~indent:true ()) content |
Yes, it's sort-of-known that |
I've found a similar bug that doesn't involve the Would this work (to fix #288) ?
|
@Drup I just had a similar problem with Would it work to just add some Lines 273 to 279 in 157c795
So that children of the node that are PCDATA would not have |
That might work, could you try it ? |
It seems the only safe way to add whitespace is to check whether we are in a context where inter-element whitespace does not matter. (Which was called the "box model" in HTML4). Only in such a context we |
The following code with indentation enabled renders a line break before the closing
</pre>
:This adds an extra blank line to the
pre
element, which renders differently whether indentation is enabled or not.The text was updated successfully, but these errors were encountered: