锅炉管代码(Boilerpipe)在Golang中是否可用?

3

有没有类似于 boilerpipe 的 Go 语言项目实现?

我尝试在谷歌上搜索,但没有找到任何结果。

2个回答

1
你有一个想法的开端,它是 mikkolehtisalo/revel/deXSSdeXSS - 用于Revel的HTML剥离
选项来清理HTML输入:
- 转义所有内容,例如使用html.EscapeString - 解析HTML输入,并使用预定义规则过滤节点
该库对标签和属性都执行后者。
它并不像boilerpipe那样完整,但这是一个开始。
func blahblah() {
    out := FilterHTML("<p>Hello <a mushroom=\"big\" href=\"/snake\">badger</a>!</p><p>Got it?</p>", allowed, true)
    // The attribute "mushroom" was not in allowed, so it will be gone!
    revel.INFO.Printf("Result of filtering: %+v", out)
}

感谢提供这些信息。我可以在我的项目中使用它。 - vvincirey

1

这正是我所寻找的。非常感谢! - vvincirey

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接