Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何预先转义&&以使 HXT 的输出包含文字&&字符而不是&&?
&&
&&
示例代码片段:
mkelem "div" [sattr "ng-show" "canEdit && isAdmin"] [ ... ]
此代码生成如下输出:
<div ng-show="canEdit amp;& isAdmin">
我希望输出是这样的:
<div ng-show="canEdit && isAdmin">
我想我想通了。我将writeDocument选项从 using切换withOutputXHTML到withOutputPLAIN. 然后&&in 属性不会被转义。
writeDocument
withOutputXHTML
withOutputPLAIN