Source File
emphasis.go
Belonging Package
github.com/yuin/goldmark/parser
package parserimport ()type emphasisDelimiterProcessor struct {}func ( *emphasisDelimiterProcessor) ( byte) bool {return == '*' || == '_'}func ( *emphasisDelimiterProcessor) (, *Delimiter) bool {return .Char == .Char}func ( *emphasisDelimiterProcessor) ( int) ast.Node {return ast.NewEmphasis()}var defaultEmphasisDelimiterProcessor = &emphasisDelimiterProcessor{}type emphasisParser struct {}var defaultEmphasisParser = &emphasisParser{}// NewEmphasisParser return a new InlineParser that parses emphasises.func () InlineParser {return defaultEmphasisParser}func ( *emphasisParser) () []byte {return []byte{'*', '_'}}func ( *emphasisParser) ( ast.Node, text.Reader, Context) ast.Node {:= .PrecendingCharacter(), := .PeekLine():= ScanDelimiter(, , 1, defaultEmphasisDelimiterProcessor)if == nil {return nil}.Segment = .WithStop(.Start + .OriginalLength).Advance(.OriginalLength).PushDelimiter()return}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |