diff options
| author | Shulhan <ms@kilabit.info> | 2022-11-21 01:20:03 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2022-11-27 21:14:18 +0700 |
| commit | 5c7bfc04dc3d2cd60e84c80229804fdcd615709e (patch) | |
| tree | 63b9749699090421b55355d0f3e1f5c1b99875a1 /inline_parser.go | |
| parent | 3d1caba74842d7dd0800cd0351ddb4c47364a541 (diff) | |
| download | asciidoctor-go-5c7bfc04dc3d2cd60e84c80229804fdcd615709e.tar.xz | |
all: implement inline macro for passthrough ("pass:")
The inline passthrough "pass:" can be used to control the substitutions
applied to a run of text.
Ref: https://docs.asciidoctor.org/asciidoc/latest/pass/pass-macro/
Diffstat (limited to 'inline_parser.go')
| -rw-r--r-- | inline_parser.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/inline_parser.go b/inline_parser.go index f7a9e8e..621c21e 100644 --- a/inline_parser.go +++ b/inline_parser.go @@ -743,6 +743,14 @@ func (pi *inlineParser) parseMacro() bool { } pi.x += n pi.prev = 0 + + case macroPass: + el, n = parseMacroPass(pi.content[pi.x+1:]) + if el == nil { + return false + } + pi.x += n + pi.prev = 0 } pi.current.raw = pi.current.raw[:len(pi.current.raw)-len(name)] @@ -934,8 +942,6 @@ func (pi *inlineParser) parseSuperscript() bool { // parseURL parser the URL, an optional text, optional attribute for target, // and optional role. -// -// The current state of p.x is equal to ":". func parseURL(doc *Document, scheme string, content []byte) (el *element, n int) { var ( x int @@ -1066,7 +1072,7 @@ func (pi *inlineParser) terminate(kind int, style int64) { // indexByteUnescape find the index of the first unescaped byte `c` on // slice of byte `in`. -// It will return nil and -1 if no unescape byte `c` found. +// It will return nil and -1 if no unescaped byte `c` found. func indexByteUnescape(in []byte, c byte) (out []byte, idx int) { var ( x int |
