Indentation changes rendering of <pre>
Open
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 179
- Forks
- 63
- Avg merge
- 5h
- Merged PRs (30d)
- 22
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the provided OCaml example with pp ~indent:true and compare its output with indentation disabled. Trace the pretty-printer entry point used by pp; the issue is done when indentation no longer adds a blank line before the closing pre element.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100