From 6609bf6d6553f2ff7a1b9ca25230202f187df9e2 Mon Sep 17 00:00:00 2001 From: Connor Ford Date: Tue, 23 Aug 2016 14:28:55 -0600 Subject: [PATCH] Remove whitespace when linebreaking quoted attributes. Closes #685 --- README.md | 4 ++-- lib/slim/parser.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b8fc832f..964f720f 100644 --- a/README.md +++ b/README.md @@ -463,8 +463,8 @@ a href=="&" You can break quoted attributes with backslash `\` ~~~ slim -a data-title="help" data-content="extremely long help text that goes on\ - and one and one and then starts over...." +a data-title="help" data-content="extremely long help text that goes on \ + and on and on and then starts over...." ~~~ #### Ruby attributes diff --git a/lib/slim/parser.rb b/lib/slim/parser.rb index 2fdce90a..3d015d87 100644 --- a/lib/slim/parser.rb +++ b/lib/slim/parser.rb @@ -491,7 +491,7 @@ def parse_quoted_attribute(quote) until count == 0 && @line[0] == quote[0] if @line =~ /\A(\\)?\Z/ - value << ($1 ? ' ' : "\n") + value << ($1 ? '' : "\n") expect_next_line else if @line[0] == ?{