In order to keep the generated code small, I propose to trim out white-spaces on all tags except <pre> or when the special rt-pre attribute is specified.
For backward compatibility, the trimming would be enabled via the switch --trim-white-space.
Example:
<div>
Hello
</div>
would result into:
return React.createElement('div', {}, '\n Hello\n'); // old way
return React.createElement('div', {}, 'Hello'); // --trim-white-space
Also:
<div rt-pre>
Hello
</div>
into:
return React.createElement('div', {}, '\n Hello\n'); // even if --trim-white-space is specified
In order to keep the generated code small, I propose to trim out white-spaces on all tags except
<pre>
or when the specialrt-pre
attribute is specified.For backward compatibility, the trimming would be enabled via the switch
--trim-white-space
.Example:
would result into:
Also:
into: