Best Practice: User generated HTML cleaning

前端 未结 4 1199
旧巷少年郎
旧巷少年郎 2021-01-02 22:47

I\'m coding a WYSIWYG editor width designMode=\"on\" on a iframe. The editor works fine and i store the code as is in the database.

Before outputing the html i need

4条回答
  •  佛祖请我去吃肉
    2021-01-02 23:09

    I looked into the same question recently with Perl as the server-side language.

    While doing so I ran into HTML Purifier which may be what you want. But obviously as it's in PHP and not Perl, I didn't actually test it out.

    Also, in my research I came to the conclusion that this is a very tricky business and consider if possible using a simplified markup language like Markdown, as suggested by Hank Gay.

提交回复
热议问题