From 0bc6bd974e955ce44b2da7ec491520df34fc44f3 Mon Sep 17 00:00:00 2001 From: Ilya Puchka Date: Tue, 13 Mar 2018 09:07:56 +0000 Subject: [PATCH] feat: allow using new lines inside tags (#202) --- CHANGELOG.md | 1 + Sources/Lexer.swift | 7 ++++++- Tests/StencilTests/LexerSpec.swift | 22 ++++++++++++++++++++++ Tests/StencilTests/VariableSpec.swift | 4 ++-- 4 files changed, 31 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1a5af3d..90e60879 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Allow default string filters to be applied to arrays - Similar filters are suggested when unknown filter is used - Added `indent` filter +- Allow using new lines inside tags ### Bug Fixes diff --git a/Sources/Lexer.swift b/Sources/Lexer.swift index 5bd590da..b2217752 100644 --- a/Sources/Lexer.swift +++ b/Sources/Lexer.swift @@ -10,7 +10,12 @@ struct Lexer { guard string.characters.count > 4 else { return "" } let start = string.index(string.startIndex, offsetBy: 2) let end = string.index(string.endIndex, offsetBy: -2) - return String(string[start..