shakespeare 2.1.3 → 2.1.4
raw patch · 4 files changed
+22/−3 lines, 4 files
Files
- ChangeLog.md +1/−1
- Text/Hamlet/Parse.hs +1/−1
- shakespeare.cabal +1/−1
- test/Text/HamletSpec.hs +19/−0
ChangeLog.md view
@@ -1,6 +1,6 @@ # ChangeLog for shakespeare -### 2.1.3+### 2.1.4 * [#292](https://github.com/yesodweb/shakespeare/pull/292) * Add support for multi-line attributes. An example use of this is [here](https://github.com/yesodweb/shakespeare/issues/291).
Text/Hamlet/Parse.hs view
@@ -283,7 +283,7 @@ contentReg InContent = (ContentRaw . return) <$> noneOf "#@^\r\n" contentReg NotInQuotes = (ContentRaw . return) <$> noneOf "@^#. \t\n\r>" contentReg NotInQuotesAttr = (ContentRaw . return) <$> noneOf "@^ \t\n\r>"- contentReg InQuotes = (ContentRaw . return) <$> noneOf "#@^\"\n\r"+ contentReg InQuotes = (ContentRaw . return) <$> noneOf "#@^\"" tagAttribValue notInQuotes = do cr <- (char '"' >> return InQuotes) <|> return notInQuotes fst <$> content cr
shakespeare.cabal view
@@ -1,5 +1,5 @@ name: shakespeare-version: 2.1.3+version: 2.1.4 license: MIT license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>
test/Text/HamletSpec.hs view
@@ -500,6 +500,25 @@ helper "<li ng-repeat=\"addr in msgForm.new.split(/\\\\s/)\">{{addr}}</li>\n" [hamlet|<li ng-repeat="addr in msgForm.new.split(/\\s/)">{{addr}}|] + it "Alpine.js multi-line attribute values #291" $ + helper "<div x-data=\"{\r\n search: '',\r\n\r\n items: ['foo', 'bar', 'baz'],\r\n\r\n get filteredItems() {\r\n return this.items.filter(\r\n i => i.startsWith(this.search)\r\n )\r\n }\r\n }\"></div>" + [hamlet| + $newline never + <div + x-data="{ + search: '', + + items: ['foo', 'bar', 'baz'], + + get filteredItems() { + return this.items.filter( + i => i.startsWith(this.search) + ) + } + }" + > + |] + it "runtime Hamlet with caret interpolation" $ do let toInclude render = render (5, [("hello", "world")]) let renderer x y = pack $ show (x :: Int, y :: [(Text, Text)])