Skip to content
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

Add a newline after the doctype declaration #58

Closed
dmbaturin opened this issue Oct 21, 2020 · 1 comment
Closed

Add a newline after the doctype declaration #58

dmbaturin opened this issue Oct 21, 2020 · 1 comment

Comments

@dmbaturin
Copy link

When people write HTML by hand, traditionally they put a newline between the doctype declaration and the <html> tag.
With long doctypes of HTML 4.01 and XHTML 1.x, that was a necessity for readability I guess, but it still looks more aesthetically pleasing even with much shorter HTML5 doctype.

Markup.ml, however, outputs them on the same line: <!DOCTYPE html><html>.

@aantron
Copy link
Owner

aantron commented Oct 22, 2020

The linked commit makes Markup.pretty_print insert a newline.

It's technically a breaking change, because it changes Markup.pretty_print's signature from

([> content_signal ] as 'a, 's) stream -> ('a, 's) stream

to

([> content_signal | `Doctype of doctype ] as 'a, 's) stream -> ('a, 's) stream

This should affect primarily users of Markup.content, but also potentially anyone who creates their own subtype streams. I suspect there are very few people who do either one of these things. I'll do a search in opam and on GitHub to try to get an estimate based on public code.

There may be other ways to implement and/or type this. However, I am leaning instead towards eliminating all this subtyping in the interface, and using just signal everywhere. That would be an even bigger breaking change, but I again suspect it will affect almost nobody. I opened #59 about that. After I do the opam search, I'm thinking to do #59, and then retag 1.0.0, as I don't want to release 2.0.0 right away, and I doubt anyone is yet relying on 1.0.0 :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants