英文:
Is boilerpipe available in golang?
问题
有没有类似于 boilerpipe 的用 Go 语言实现的项目?
我在谷歌上搜索了一下,但没有找到任何相关的项目。
英文:
Is there any boilerpipe like project implemented in go language?
i tried searching in google but didn't find any
答案1
得分: 1
你有一个想法的开端是mikkolehtisalo/revel/deXSS
deXSS
- 用于 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)
// 属性 "mushroom" 不在 allowed 中,所以它将被删除!
revel.INFO.Printf("过滤结果: %+v", out)
}
英文:
You have the beginning of that idea is mikkolehtisalo/revel/deXSS
deXSS
- HTML Stripping for Revel
> Options for sanitizing HTML input:
> - Escaping everything, e.g. with html.EscapeString
- Parse HTML input, and filter the nodes using pre-defined rules
> This library does the latter for both tags and attributes.
It is not near as complete as boilerpipe, but it is a start.
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)
}
答案2
得分: 1
你可能想看一下Goose:
https://github.com/advancedlogic/GoOse
英文:
You might want to have a look at Goose:
https://github.com/advancedlogic/GoOse
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论