2024-02-17 06:35:49 +00:00
|
|
|
package document
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"git.foosoft.net/alex/goldsmith"
|
|
|
|
"git.foosoft.net/alex/goldsmith/harness"
|
|
|
|
"github.com/PuerkitoBio/goquery"
|
|
|
|
)
|
|
|
|
|
2024-02-20 00:26:41 +00:00
|
|
|
func process(file goldsmith.File, doc *goquery.Document) error {
|
2024-02-17 06:35:49 +00:00
|
|
|
doc.Find("h1").SetAttr("style", "color: red;")
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func Test(self *testing.T) {
|
|
|
|
type Processor func(*goquery.Document) error
|
|
|
|
|
|
|
|
harness.Validate(
|
|
|
|
self,
|
|
|
|
func(gs *goldsmith.Goldsmith) {
|
|
|
|
gs.Chain(New(process))
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|