strip tags python

后端 未结 9 1651
深忆病人
深忆病人 2020-12-17 23:07

i want the following functionality.

input : this is test  bold text  normal text
expected output: this is test normal text
9条回答
  •  北荒
    北荒 (楼主)
    2020-12-17 23:17

    I would use http://code.google.com/p/html5lib/ if you want to include some safe tags.

    See the "Sanitizing Tokenizer" section at http://code.google.com/p/html5lib/wiki/UserDocumentation.

    Remember to test for vulnerabilities if it's an important service: http://ha.ckers.org/xss.html.

提交回复
热议问题