Newlines in html template in minified js?
See original GitHub issueDownloading 3.1.2 from NPM (and other versions as far as I can tell) seems to contain newlines in the html template used for displaying the cursor flag. These newlines render and make it appear as though there is a lot of padding around the name.
I narrowed it down to this minified code:
o='\n <span class="'.concat(i.default.SELECTION_CLASS,'"></span>\n <span class="').concat(i.default.CARET_CONTAINER_CLASS,'">\n <span class="').concat(i.default.CARET_CLASS,'"></span>\n </span>\n <div class="').concat(i.default.FLAG_CLASS,'">\n <small class="').concat(i.default.NAME_CLASS,'"></small>\n </div>\n');
When I remove the newlines from that minified code, everything renders quite well. Seems like this is unintentional.
Attached image of how it looks (with text selected highlighting the newline). Let me know if I’m just missing something!
Issue Analytics
- State:
- Created a year ago
- Comments:5 (1 by maintainers)
Top GitHub Comments
Omg @alecgibson you nailed it! The container I had this in had
white-space: pre-wrap;
and when I removed that, the cursor was displaying as desired. Thanks for pointing this out; I hadn’t realized the implications of that css property (and I think I accidentally left it there after some experimentation on an unrelated issue). I think we can close this issue - thank you!!@IvanVolons I’m not sure I understand the issue. Whitespace should be collapsed by the browser, so newlines in the source code shouldn’t matter, unless you’ve set something like
white-space: pre;
?Can you please check the
white-space
value of that DOM node, and report back? It should be set (by this library) tonowrap
. If that looks normal, let us know which browser you’re using, and please provide an MWE.