hugo/tpl
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
..
cast Add Markdown diagrams and render hooks for code blocks 2022-02-24 18:59:50 +01:00
collections Cache reflect.MethodByName 2022-03-08 19:36:55 +01:00
compare Add Markdown diagrams and render hooks for code blocks 2022-02-24 18:59:50 +01:00
crypto Add Markdown diagrams and render hooks for code blocks 2022-02-24 18:59:50 +01:00
data Add Markdown diagrams and render hooks for code blocks 2022-02-24 18:59:50 +01:00
debug Add Markdown diagrams and render hooks for code blocks 2022-02-24 18:59:50 +01:00
diagrams tpl/diagrams: Rename the SVG accessor to Wrapped 2022-02-27 19:51:40 +01:00
encoding Add Markdown diagrams and render hooks for code blocks 2022-02-24 18:59:50 +01:00
fmt Add Markdown diagrams and render hooks for code blocks 2022-02-24 18:59:50 +01:00
hugo Add Markdown diagrams and render hooks for code blocks 2022-02-24 18:59:50 +01:00
images Add Markdown diagrams and render hooks for code blocks 2022-02-24 18:59:50 +01:00
inflect Add Markdown diagrams and render hooks for code blocks 2022-02-24 18:59:50 +01:00
internal Cache reflect.MethodByName 2022-03-08 19:36:55 +01:00
js Fix error handling for the time func alias 2021-08-01 13:39:30 +02:00
lang Add Markdown diagrams and render hooks for code blocks 2022-02-24 18:59:50 +01:00
math Add Markdown diagrams and render hooks for code blocks 2022-02-24 18:59:50 +01:00
openapi/openapi3 Simplify some integration tests 2022-02-10 20:43:19 +01:00
os tpl/os: Revert readDir in theme behaviour 2022-03-04 08:43:47 +01:00
partials tpl/partials: Fix partialCached deadlock regression 2022-03-02 11:16:21 +01:00
path Add Markdown diagrams and render hooks for code blocks 2022-02-24 18:59:50 +01:00
reflect Add Markdown diagrams and render hooks for code blocks 2022-02-24 18:59:50 +01:00
resources tpl/resources: Add empty method mapping for GetRemote 2021-12-17 10:30:10 +01:00
safe Add Markdown diagrams and render hooks for code blocks 2022-02-24 18:59:50 +01:00
site Add Markdown diagrams and render hooks for code blocks 2022-02-24 18:59:50 +01:00
strings Remove the trailing new line in .Code 2022-02-26 21:54:36 +01:00
templates Add Markdown diagrams and render hooks for code blocks 2022-02-24 18:59:50 +01:00
time Add Markdown diagrams and render hooks for code blocks 2022-02-24 18:59:50 +01:00
tplimpl Add lang attribute to internal alias template 2022-03-09 19:06:59 +01:00
transform Fail with error when double-rendering text in markdownify/RenderString 2022-03-10 08:19:03 +01:00
urls Add Markdown diagrams and render hooks for code blocks 2022-02-24 18:59:50 +01:00
template.go tpl/partials: Fix recently introduced deadlock in partials cache 2022-02-17 18:47:36 +01:00
template_info.go Add --printUnusedTemplates 2022-02-15 20:01:57 +01:00
template_test.go