Q：How do I make a directive use filtered HTML attributes?

Q：如何使一个指令使用过滤HTML属性？

I have a directive that builds a popup menu which automatically collects data from HTML. It is actually supposed to convert a set of Bootstrap carousel-compliant elements, into a list. A catch is that each .item carries an attribute with its string value filtered, as in: