mirror of
https://github.com/kovetskiy/mark.git
synced 2026-05-03 14:47:38 +08:00
refactor: replace regexputil-go with standard library SubexpIndex
This commit is contained in:
parent
7be2325340
commit
724066906c
1
go.mod
1
go.mod
@ -11,7 +11,6 @@ require (
|
|||||||
github.com/kovetskiy/lorg v1.2.1-0.20240830111423-ba4fe8b6f7c4
|
github.com/kovetskiy/lorg v1.2.1-0.20240830111423-ba4fe8b6f7c4
|
||||||
github.com/reconquest/karma-go v1.5.0
|
github.com/reconquest/karma-go v1.5.0
|
||||||
github.com/reconquest/pkg v1.3.1-0.20240901105413-68c2adbf2b64
|
github.com/reconquest/pkg v1.3.1-0.20240901105413-68c2adbf2b64
|
||||||
github.com/reconquest/regexputil-go v0.0.0-20160905154124-38573e70c1f4
|
|
||||||
github.com/stefanfritsch/goldmark-admonitions v1.1.1
|
github.com/stefanfritsch/goldmark-admonitions v1.1.1
|
||||||
github.com/stretchr/testify v1.11.1
|
github.com/stretchr/testify v1.11.1
|
||||||
github.com/urfave/cli-altsrc/v3 v3.1.0
|
github.com/urfave/cli-altsrc/v3 v3.1.0
|
||||||
|
|||||||
2
go.sum
2
go.sum
@ -77,8 +77,6 @@ github.com/reconquest/karma-go v1.5.0 h1:Chn4LtauwnvKfz13ZbmGNrRLKO1NciExHQSOBOs
|
|||||||
github.com/reconquest/karma-go v1.5.0/go.mod h1:52XRXXa2ec/VNrlCirwasdJfNmjI1O87q098gmqILh0=
|
github.com/reconquest/karma-go v1.5.0/go.mod h1:52XRXXa2ec/VNrlCirwasdJfNmjI1O87q098gmqILh0=
|
||||||
github.com/reconquest/pkg v1.3.1-0.20240901105413-68c2adbf2b64 h1:OBNLiZay5PYLmGRXGIMEgWSIgbSjOj8nHZxqwLbSsF4=
|
github.com/reconquest/pkg v1.3.1-0.20240901105413-68c2adbf2b64 h1:OBNLiZay5PYLmGRXGIMEgWSIgbSjOj8nHZxqwLbSsF4=
|
||||||
github.com/reconquest/pkg v1.3.1-0.20240901105413-68c2adbf2b64/go.mod h1:r1Z1JNh3in9xLWbhv5u7cdox9vvGFjlKp89VI10Jrdo=
|
github.com/reconquest/pkg v1.3.1-0.20240901105413-68c2adbf2b64/go.mod h1:r1Z1JNh3in9xLWbhv5u7cdox9vvGFjlKp89VI10Jrdo=
|
||||||
github.com/reconquest/regexputil-go v0.0.0-20160905154124-38573e70c1f4 h1:bcDXaTFC09IIg13Z8gfQHk4gSu001ET7ssW/wKRvPzg=
|
|
||||||
github.com/reconquest/regexputil-go v0.0.0-20160905154124-38573e70c1f4/go.mod h1:OI1di2iiFSwX3D70iZjzdmCPPfssjOl+HX40tI3VaXA=
|
|
||||||
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
|
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
|
||||||
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
|
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
|
||||||
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
||||||
|
|||||||
@ -10,7 +10,6 @@ import (
|
|||||||
"github.com/kovetskiy/mark/v16/includes"
|
"github.com/kovetskiy/mark/v16/includes"
|
||||||
"github.com/reconquest/karma-go"
|
"github.com/reconquest/karma-go"
|
||||||
"github.com/reconquest/pkg/log"
|
"github.com/reconquest/pkg/log"
|
||||||
"github.com/reconquest/regexputil-go"
|
|
||||||
"go.yaml.in/yaml/v3"
|
"go.yaml.in/yaml/v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -126,13 +125,9 @@ func ExtractMacros(
|
|||||||
groups := reMacroDirective.FindStringSubmatch(string(spec))
|
groups := reMacroDirective.FindStringSubmatch(string(spec))
|
||||||
|
|
||||||
var (
|
var (
|
||||||
expr = regexputil.Subexp(reMacroDirective, groups, "expr")
|
expr = groups[reMacroDirective.SubexpIndex("expr")]
|
||||||
template = regexputil.Subexp(
|
template = groups[reMacroDirective.SubexpIndex("template")]
|
||||||
reMacroDirective,
|
config = groups[reMacroDirective.SubexpIndex("config")]
|
||||||
groups,
|
|
||||||
"template",
|
|
||||||
)
|
|
||||||
config = regexputil.Subexp(reMacroDirective, groups, "config")
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var macro Macro
|
var macro Macro
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user