Skip to content

Deal with indentation gaps #14

Closed
buschtoens opened this Issue May 27, 2013 · 2 comments

2 participants

@buschtoens

When you leave blank lines without the proper indentation between two properties css-whitespace fails. This is a problem, becaue many code editors automatically remove the whitespace in otherwise empty lines.

css-whitespace should ignore those lines, i.e. remove every line that only contains whitespace: css.replace(/\s+\n/gm, "");

@buschtoens buschtoens referenced this issue in reworkcss/rework May 27, 2013
Closed

Stylus/sass/less-like nesting #85

@buschtoens

css.replace(/[^\S\n]+\n$/gm, "") looks better. Now it seesm to work. I also auto remove all \r, because they aren't stripped out by css-whitespace.

function parse(css) {
  return rework(
    whitespace(
      css.replace(/(?:[^\S\n]+\n|\r)$/gm, "")
    )
   ).toString();
}
@tj
rework member
tj commented Jun 2, 2013

ah yeah I always miss this since my editor strips trailing ws, ill patch

@tj tj closed this in e122484 Jun 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.