Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table render hook: incorrect position in source file printed out #13412

Open
deining opened this issue Feb 17, 2025 · 1 comment
Open

Table render hook: incorrect position in source file printed out #13412

deining opened this issue Feb 17, 2025 · 1 comment

Comments

@deining
Copy link
Contributor

deining commented Feb 17, 2025

Closely related to #13406 and already mentioned there:

I'm using this table render hook:

{{ with $.Page.GetPage "posts/non-existing.md" }}
  {{- .RenderShortcodes }}
{{ else }}
  {{ errorf "Error in page '%s':  %s" $.Page.Name  $.Position }}
{{ end }}

I'm getting:

ERROR Error in page 'Examples':
"/path/to site/content/lang/section/subsection/_index.md:0:1"

Bug

The position given in the last line is always 0:1, regardless of the actual position of the offending code in the source file.

Remark: I tested all available render hooks, results see table below. I realized that the Headings, Images and Links render hooks do not have .Position in their context. Is that on purpose?

Render hook Context has Position Position correct
Block quote yes yes
Code blocks yes yes
Headings no -
Images no -
Links no -
Pass through yes yes
Table yes no

What version of Hugo are you using (hugo version)?

$ hugo version
hugo v0.144.0-DEV-641403f7de3+extended

Does this issue reproduce with the latest release?

Yes.

@bep bep added S0 and removed NeedsTriage labels Feb 17, 2025
@bep bep added this to the Unscheduled milestone Feb 17, 2025
@bep
Copy link
Member

bep commented Feb 17, 2025

Is that on purpose?

Yes, budget restrictions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants