Skip to content

Commit 797c446

Browse files
committed
Heredoc strings.
Fixed a problem with combining --fullpaths and --meta.
1 parent c2b588a commit 797c446

File tree

3 files changed

+165
-42
lines changed

3 files changed

+165
-42
lines changed

examples/testsite/content/tests.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ An image < <img src="{{ /images/head.png }}"> > inside markdown.
2323

2424
An image < {{ '<img src="'..url'/images/head.png'..'">' }} > inside markdown.
2525

26-
{{-- Line comment. {{"nope"}}
26+
{{-- Line comment. {{"ignored"}}
2727
}}
28-
{{--[[ Block comment. {{"nope"}} ]]}}
29-
{{--[=[ --[[ Messy block comment. {{"nope"}} ]] ]=]}}
28+
{{--[[ Block comment. {{"ignored"}} ]]}}
29+
{{--[=[ --[[ Messy block comment. {{"ignored"}} ]] ]=]}}
3030

3131
{{
3232
-- globalVar = 123 -- Error: Cannot assign globals!
@@ -113,6 +113,32 @@ Markdown parsing, problematic link: [Snake!](https://en.wikipedia.org/wiki/Snake
113113

114114
Markdown parsing, solution: [Snake!](<https://en.wikipedia.org/wiki/Snake_(video_game_genre)>)
115115

116+
{{
117+
-- Heredoc strings.
118+
local s1 = ===
119+
}}
120+
abc
121+
{{ 1+8 }}
122+
xyz
123+
{{
124+
===
125+
local s2 = ===
126+
*}}
127+
abc
128+
{{ 1+8 }}
129+
xyz
130+
{{*
131+
===
132+
133+
echoRaw("<div>\n<pre>")
134+
echo(s1)
135+
echoRaw("</pre>\n</div>")
136+
137+
echoRaw("<div>\n<pre>")
138+
echo(s2)
139+
echoRaw("</pre>\n</div>")
140+
}}
141+
116142

117143

118144
## Value Expressions

src/app.lua2p

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,7 @@ local function setup()
12021202
-- Hacks. (These are not very robust!)
12031203
----------------------------------------------------------------
12041204

1205-
XXX_minimizeCss = function(s)
1205+
XXX_minimizeCss = function(s, sourcePath)
12061206
local oldLen = #s
12071207
local header = s:match"^/%*.-%*/" or ""
12081208

@@ -1217,13 +1217,13 @@ local function setup()
12171217
)
12181218

12191219
!if DEV then
1220-
if verbosePrint then printf("[opti] %s from %d to %d (diff=%d)", getFilename(path), oldLen, #s, oldLen-#s) end
1220+
if verbosePrint then printf("[opti] %s from %d to %d (diff=%d)", getFilename(sourcePath or "<css>"), oldLen, #s, oldLen-#s) end
12211221
!end
12221222

12231223
return s
12241224
end,
12251225

1226-
XXX_minimizeJavaScript = function(s)
1226+
XXX_minimizeJavaScript = function(s, sourcePath)
12271227
local oldLen = #s
12281228
local header = s:match"^/%*.-%*/" or ""
12291229

@@ -1236,13 +1236,13 @@ local function setup()
12361236
)
12371237

12381238
!if DEV then
1239-
if verbosePrint then printf("[opti] %s from %d to %d (diff=%d)", getFilename(path), oldLen, #s, oldLen-#s) end
1239+
if verbosePrint then printf("[opti] %s from %d to %d (diff=%d)", getFilename(sourcePath or "<css>"), oldLen, #s, oldLen-#s) end
12401240
!end
12411241

12421242
return s
12431243
end,
12441244

1245-
XXX_minimizeHtaccess = function(s)
1245+
XXX_minimizeHtaccess = function(s, sourcePath)
12461246
local oldLen = #s
12471247

12481248
s = (s
@@ -1252,7 +1252,7 @@ local function setup()
12521252
)
12531253

12541254
!if DEV then
1255-
if verbosePrint then printf("[opti] %s from %d to %d (diff=%d)", getFilename(path), oldLen, #s, oldLen-#s) end
1255+
if verbosePrint then printf("[opti] %s from %d to %d (diff=%d)", getFilename(sourcePath or "<css>"), oldLen, #s, oldLen-#s) end
12561256
!end
12571257

12581258
return s

0 commit comments

Comments
 (0)