Skip to content

Improve the render hooks .Position#14664

Draft
bep wants to merge 1 commit intogohugoio:masterfrom
bep:feat/goldmarkpos
Draft

Improve the render hooks .Position#14664
bep wants to merge 1 commit intogohugoio:masterfrom
bep:feat/goldmarkpos

Conversation

@bep
Copy link
Copy Markdown
Member

@bep bep commented Mar 24, 2026

Goldmark v1.8 reports source positions in render hooks.
Use this to build a source map that translates Goldmark positions back to
the original content source.

Now all render hooks' context object implenent the BaseContext interface:

type BaseContext interface {
	Position() Position
	Page() any
	PageInner() any
	Ordinal() int
}

Closes #14663

Goldmark v1.8 reports source positions in render hooks.
Use this to build a source map that translates Goldmark positions back to
the original content source.

Now all render hooks' context object implenent the `BaseContext` interface:

```go
type BaseContext interface {
	Position() Position
	Page() any
	PageInner() any
	Ordinal() int
}
```

Closes gohugoio#14663

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bep bep force-pushed the feat/goldmarkpos branch from c800eee to 7fcc98a Compare March 25, 2026 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve the render hooks .Position

1 participant