You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.
// Package parser turns the source text into a sequence of blocks.
package parser
import (
"bytes"
"github.com/bouncepaw/mycomarkup/v3/blocks"
"github.com/bouncepaw/mycomarkup/v3/mycocontext"
)
// parseSubdocumentForEachBlock replaces the buffer in the given context and parses the document contained in the buffer. The function is called on every block.
func parseSubdocumentForEachBlock(ctx mycocontext.Context, buf *bytes.Buffer, f func(block blocks.Block)) {
ctx = mycocontext.WithBuffer(ctx, buf)
var (
done bool
token blocks.Block
)
for !done {
token, done = NextToken(ctx)
if token != nil {
f(token)
}
}
}
// parseLegacyHeading is like parseHeading but for #headings.