File tree Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Expand file tree Collapse file tree 2 files changed +38
-1
lines changed Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ func (scp *ShortcodeWithPage) page() page.Page {
186
186
const shortcodePlaceholderPrefix = "HAHAHUGOSHORTCODE"
187
187
188
188
func createShortcodePlaceholder (id string , ordinal int ) string {
189
- return shortcodePlaceholderPrefix + "-" + id + strconv .Itoa (ordinal ) + "- HBHB"
189
+ return shortcodePlaceholderPrefix + id + strconv .Itoa (ordinal ) + "HBHB"
190
190
}
191
191
192
192
type shortcode struct {
Original file line number Diff line number Diff line change @@ -1276,3 +1276,40 @@ Inner: {{ .Get 0 }}: {{ len .Inner }}
1276
1276
b .Assert (err , qt .Not (qt .IsNil ))
1277
1277
b .Assert (err .Error (), qt .Contains , `p1.md:5:1": failed to extract shortcode: shortcode "sc" must be closed or self-closed` )
1278
1278
}
1279
+
1280
+ // Issue 10819.
1281
+ func TestShortcodeInCodeFenceHyphen (t * testing.T ) {
1282
+ t .Parallel ()
1283
+
1284
+ files := `
1285
+ -- config.toml --
1286
+ disableKinds = ["home", "taxonomy", "term"]
1287
+ -- content/p1.md --
1288
+ ---
1289
+ title: "p1"
1290
+ ---
1291
+
1292
+ §§§go
1293
+ {{< sc >}}
1294
+ §§§
1295
+
1296
+ Text.
1297
+
1298
+ -- layouts/shortcodes/sc.html --
1299
+ Hello.
1300
+ -- layouts/_default/single.html --
1301
+ {{ .Content }}
1302
+ `
1303
+
1304
+ b := NewIntegrationTestBuilder (
1305
+ IntegrationTestConfig {
1306
+ T : t ,
1307
+ TxtarString : files ,
1308
+ Running : true ,
1309
+ Verbose : true ,
1310
+ },
1311
+ ).Build ()
1312
+
1313
+ b .AssertFileContent ("public/p1/index.html" , "<span style=\" color:#a6e22e\" >Hello.</span>" )
1314
+
1315
+ }
You can’t perform that action at this time.
0 commit comments