Now that Goldmark has a Node.Pos() (in >= v1.8.0) we can do better, so that should make it easier/cheaper to calculate, so I suggest that we
- Add
.Position to all render hooks (which makes all hooks at least implement the interface below).
- Simplify the implementation.
type BaseContext interface {
Position() Position
Page() any
PageInner() any
Ordinal() int
}
Now that Goldmark has a
Node.Pos()(in >= v1.8.0) we can do better, so that should make it easier/cheaper to calculate, so I suggest that we.Positionto all render hooks (which makes all hooks at least implement the interface below).