我有一个关于 angular-sanitize($sanitize)[1] 的问题。为什么它不允许输入和按钮元素?
示例代码:
$sanitize('<input/>') // ""
$sanitize('<button>A</button>') // ""
我查看了代码,发现有硬编码的有效元素 [2]。我的问题更多关于“为什么他们将它们视为有害元素”
谢谢!
[1] - https://github.com/angular/angular.js/blob/0822d34b10ea0371c260c80a1486a4d508ea5a91/src/ngSanitize/sanitize.js#L1 [2] - https://github.com/angular/angular.js/blob /0822d34b10ea0371c260c80a1486a4d508ea5a91/src/ngSanitize/sanitize.js#L265-L269