Add autoescape support.
Fix the bug that for subsequent tags the attributes are incorrectly mixed.
Merge from master to branch-1.0.