question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Leading/Trailing Whitespace

See original GitHub issue

I’m trying to make Twitter Bootstrap Dropdown, which requires a space between the bound button label and the .caret class to look right, and I can’t figure out a way to do this in emblem. In slim, I would use either a leading space on the caret or a trailing space on the html ouptut:

.dropdown
    a.btn.btn-default.dropdown-toggle href="#" data-toggle="dropdown"
        => timePeriodLabel
        span.caret

Here are the respective links to the slim documentation: https://github.com/slim-template/slim#trailing-and-leading-whitespace-- https://github.com/slim-template/slim#output-

The only thing I could find in Emblem was the legacy slim trailing space notation in the “Plain Text” section here: http://emblemjs.com/syntax/

I have tried the following: =>, =<, =', span.caret>, span.caret<

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
typeoneerrorcommented, Aug 31, 2014

+1

Only way I’ve been able to achieve this is like so:

.page-header
  h1
    = name
    '
    small = slug

The ’ with a blank line forces a space b/t elements. Gross, but works.

0reactions
wmlelecommented, Sep 26, 2014

What I meant is a way to add a space after the element when it is actually followed by another element at the same level (and not if it is the last element in the container), reproducing how newlines between elements are rendered as a whitespace in html and plain handlebars. I don’t use slim, but haml does the right thing most of the times, and I rarely had to force whitespace.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Leading and trailing whitespace - Data auditing and cleaning
There are procedures for deleting trailing whitespace in C, Python, Vim, PHP, Java, Visual Studio, R, C++, JavaScript, etc etc. Nobody wants ...
Read more >
c++ - what is meant by trailing space and what's the difference ...
Trailing space is all whitespace located at the end of a line, without any other characters following it. This includes spaces (what you ......
Read more >
5.12. Trim Leading and Trailing Whitespace - O'Reilly
To keep things simple and fast, the best all-around solution is to use two substitutions—one to remove leading whitespace, and another to remove...
Read more >
Remove Leading/Trailing Whitespace - R
a character string specifying whether to remove both leading and trailing whitespace (default), or only leading ( "left" ) or trailing ( "right"...
Read more >
How to Remove Leading and Trailing Spaces in Excel
Leading spaces (at the start of the text), Trailing spaces (at the end of the text) and Non-Breaking spaces (prevents line breaks from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found