Add attribute support to markup generator, plus tests.