Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Improve the render hooks .Position #14663

@bep

Description

@bep

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
}

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions