# Passing attributes to render hook: error is silently ignored

**URL:** <https://discourse.gohugo.io/t/passing-attributes-to-render-hook-error-is-silently-ignored/43430>\
**Category:** support\
**Created:** [March 14, 2023, 8:47am UTC](https://discourse.gohugo.io/t/passing-attributes-to-render-hook-error-is-silently-ignored/43430 "2023-03-14T08:47:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![deining](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/deining/32/13944_2.png) [@deining](https://discourse.gohugo.io/u/deining)\
**Post date:** [March 14, 2023, 8:47am UTC](https://discourse.gohugo.io/t/passing-attributes-to-render-hook-error-is-silently-ignored/43430/1 "2023-03-14T08:47:55Z")

</div>

During development, I came across an issue that I would like to report an discuss:

I authored a custom render hook for a code block. Then I used this code block in my page and passed attributes to the newly created render hook:

````auto
```my-customblock { color=red dimensions=XL }
BODY
```

````

With this code, a filled map is correctly passed to my render hook (accessible via `.Attributes`):

```auto
map[color:red dimensions:XL] 

```

However, using this code

````auto
```my-customblock { color=red dimensions=300x200 }
BODY
```

````

an empty map is passed to my render hook:

```auto
map[] 

```

This was unexpected, I soon realized that you have to quote the value `300x200` in order to make it work:

````auto
```my-customblock { color="red" dimensions="300x200" }
BODY
```

````

Now my issue: I consider discarding given values and passing an empty map as error, but currently `hugo` silently ignores this error situation. IMHO `hugo` should be more strict here and emit an error (or at least a warning). No idea if this is something that can be achieved easily. WDYT?

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [March 14, 2023, 11:25am UTC](https://discourse.gohugo.io/t/passing-attributes-to-render-hook-error-is-silently-ignored/43430/2 "2023-03-14T11:25:24Z")

</div>

> <https://github.com/gohugoio/hugo/issues/10835>
>
> See https://discourse.gohugo.io/t/passing-attributes-to-render-hook-error-is-sil…ently-ignored/43430

Some of this may be inherited from the GoldMark markdown library we use, but I suspect that we should be able to improve on this. I suspect that the original motivation was something in the line of “if it does not parse as an attribute block, then it’s something else …”.
