Files
hugo/hugolib
Bjørn Erik Pedersen 4e14cf7607 Fail with error when double-rendering text in markdownify/RenderString
This commit prevents the most commons case of infinite recursion in link render hooks when the `linkify` option is enabled (see below). This is always a user error, but getting a `stack overflow` (the current stack limit in Go is 1 GB on 64-bit, 250 MB on 32-bit) error isn't very helpful. This fix will not prevent all such errors, though, but we may do better once #9570 is in place.

So, these will fail:

```
<a href="{{ .Destination | safeURL }}" >{{ .Text | markdownify }}</a>
<a href="{{ .Destination | safeURL }}" >{{ .Text | .Page.RenderString }}</a>
```

`.Text` is already rendered to `HTML`. The above needs to be rewritten to:

```
<a href="{{ .Destination | safeURL }}" >{{ .Text | safeHTML }}</a>
<a href="{{ .Destination | safeURL }}" >{{ .Text | safeHTML }}</a>
```

Fixes #8959
2022-03-10 08:19:03 +01:00
..
2019-08-26 15:00:44 +02:00
2021-06-14 17:00:32 +02:00
2022-02-23 22:43:19 +01:00
2020-12-03 13:12:58 +01:00
2021-06-07 19:11:03 +02:00
2020-12-16 12:11:32 +01:00
2022-02-16 13:23:43 +01:00
2022-01-04 17:10:39 +01:00
2021-07-28 11:51:13 +02:00
2022-02-23 22:43:19 +01:00
2021-07-15 17:14:26 +02:00
2020-12-03 13:12:58 +01:00
2020-12-03 13:12:58 +01:00
2022-01-11 18:06:23 +01:00
2021-06-14 17:00:32 +02:00
2021-07-30 21:07:52 +02:00
2020-12-03 13:12:58 +01:00
2022-02-23 22:43:19 +01:00
2020-12-03 13:12:58 +01:00
2020-12-03 13:12:58 +01:00
2020-12-03 13:12:58 +01:00
2020-12-03 13:12:58 +01:00
2020-12-03 13:12:58 +01:00
2020-12-03 13:12:58 +01:00
2019-03-23 18:51:22 +01:00
2021-10-16 15:22:03 +02:00
2021-05-04 17:59:04 +02:00
2020-12-03 13:12:58 +01:00
2021-06-14 17:00:32 +02:00
2022-01-04 17:10:39 +01:00
2020-12-03 13:12:58 +01:00
2022-01-04 17:10:39 +01:00
2020-12-03 13:12:58 +01:00
2020-12-16 12:11:32 +01:00
2019-08-08 20:13:39 +02:00