Skip to content

use of angular brackets in attribute causes template to error out #52

@xpressivecode

Description

@xpressivecode

works

{{foo}}

fails

[data-colour="{{foo}}"]

It looks like you have a fix in place for the text parser that converts {{foo}} to {{"{{"}}foo{{"}}"}}. However, if you attempt to use angular brackets on a tags attribute, it will cause the template package to throw an error.

When the tag parser loops through the attributes, would it be possible to have it call the same regex replace as the text parser?

Or do you have another work around?

I did try moving the regex replace into it's own function and then having the visitText use it, as well as the attribute loop right at the end to replace the value. It fixed my particular issue, but does cause 1 test to fail. Test_FuncCall.

I tried just using the compiler to output a string via CompileString() and then using a new template, changing the delimiter, but then because of the visitText regex, it's producing invalid angularjs as the template ignores the {{"{{"}} etc. as the delimiter has changed. So while that fixes the attribute issue, it introduces an issue with the text parser.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions