eeue56/elm-static-html

Allow configuring the indent and newlines from config file.

Opened this issue · 3 comments

When newlines are automatically inserted by this tool, the browser inserts spaces between inline block elements. This can negatively impact layout. For example see:

https://stackoverflow.com/questions/5078239/how-to-remove-the-space-between-inline-block-elements

I propose to add configuration options for indentation and newlines into the config file defaulting to the current values of 4 spaces and true respectively.

I have problems with this as well, since elm doesn't put spaces when rendering elements, the prerendered layout and the hydrated one ends up different

As a workaround, I'm using this:

<%
  var html = require('../build/static/pages/index.html');
  var trimmedHtml = html.replace(/[\s\t\n]*</g, '<').replace(/>[\s\t\n]*/g, '>')
%>
<div id="app"><%= trimmedHtml %></div>

FWIW opening an issue in elm-static-html-lib. I really recommend switching to that if possible, since I plan to maintain that one going forwards, even after 0.19