Boilerpipe在golang中可用吗?

huangapple go评论105阅读模式
英文:

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

huangapple
  • 本文由 发表于 2014年7月9日 18:47:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/24651627.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定