markup: Add blockquote render hooks

Closes #12590
This commit is contained in:
Bjørn Erik Pedersen
2024-08-05 16:51:16 +02:00
parent 4c162deb03
commit 665ac949bd
9 changed files with 453 additions and 2 deletions

View File

@@ -440,8 +440,8 @@ func (pco *pageContentOutput) initRenderHooks() error {
var offset int
switch v := ctx.(type) {
case hooks.CodeblockContext:
offset = bytes.Index(source, []byte(v.Inner()))
case hooks.PositionerSourceTargetProvider:
offset = bytes.Index(source, v.PositionerSourceTarget())
}
pos := pco.po.p.posFromInput(source, offset)
@@ -481,6 +481,11 @@ func (pco *pageContentOutput) initRenderHooks() error {
if id != nil {
layoutDescriptor.KindVariants = id.(string)
}
case hooks.BlockquoteRendererType:
layoutDescriptor.Kind = "render-blockquote"
if id != nil {
layoutDescriptor.KindVariants = id.(string)
}
case hooks.CodeBlockRendererType:
layoutDescriptor.Kind = "render-codeblock"
if id != nil {