# Resolvable

{{ abc }}

==>

Document(
  Resolvable
)

# Resolvable, Text

{{ abc }}xyz

==>

Document(Resolvable, Text)

# Text, Resolvable

xyz{{ abc }}

==>

Document(Text, Resolvable)

# Regular tag, Resolvable, regular tag

<foo>{{ abc }}</foo>

==>

Document(
  Element(
    OpenTag(StartTag,TagName,EndTag),
    Resolvable,
    CloseTag(StartCloseTag,TagName,EndTag)
  )
)

# Resolvable then regular tags

{{ abc }}<foo></foo>

==>

Document(
  Resolvable,
  Element(
    OpenTag(StartTag,TagName,EndTag),
    CloseTag(StartCloseTag,TagName,EndTag)
  )
)

# Regular tags then resolvable

<foo></foo>{{ abc }}

==>

Document(
  Element(
    OpenTag(StartTag,TagName,EndTag),
    CloseTag(StartCloseTag,TagName,EndTag)
  ),
  Resolvable
)

# Regular tag, Resolvable, Text, regular tag

<foo>{{ abc }}xyz</foo>

==>

Document(
  Element(
    OpenTag(StartTag,TagName,EndTag),
    Resolvable,
    Text,
    CloseTag(StartCloseTag,TagName,EndTag)
  )
)

# Regular tag, Text, Resolvable, regular tag

<foo>xyz{{ abc }}</foo>

==>

Document(
  Element(
    OpenTag(StartTag,TagName,EndTag),
    Text,
    Resolvable,
    CloseTag(StartCloseTag,TagName,EndTag)
  )
)

# Regular tag, Text, Resolvable, Text, regular tag

<foo>xyz{{ abc }}xyz</foo>

==>

Document(
  Element(
    OpenTag(StartTag,TagName,EndTag),
    Text,
    Resolvable,
    Text,
    CloseTag(StartCloseTag,TagName,EndTag)
  )
)

# Resolvable inside attribute value (double quotes)

<img src="{{ $json.url }}" />

==>

Document(
  Element(
    SelfClosingTag(StartTag,TagName,Attribute(AttributeName,Is,AttributeValue(Resolvable)),EndTag)
  )
)

# Resolvable mixed with text inside attribute value

<img src="https://example.com/{{ $json.id }}.jpg" />

==>

Document(
  Element(
    SelfClosingTag(StartTag,TagName,Attribute(AttributeName,Is,AttributeValue(Resolvable)),EndTag)
  )
)

# Single brace only in double-quoted attribute

<div attr="{"></div>

==>

Document(
  Element(
    OpenTag(StartTag,TagName,Attribute(AttributeName,Is,AttributeValue),EndTag),
    CloseTag(StartCloseTag,TagName,EndTag)
  )
)

# Single brace only in single-quoted attribute

<div attr='{'></div>

==>

Document(
  Element(
    OpenTag(StartTag,TagName,Attribute(AttributeName,Is,AttributeValue),EndTag),
    CloseTag(StartCloseTag,TagName,EndTag)
  )
)

# Single brace at end of double-quoted attribute

<div attr="a{"></div>

==>

Document(
  Element(
    OpenTag(StartTag,TagName,Attribute(AttributeName,Is,AttributeValue),EndTag),
    CloseTag(StartCloseTag,TagName,EndTag)
  )
)

# Single brace at end of single-quoted attribute

<div attr='a{'></div>

==>

Document(
  Element(
    OpenTag(StartTag,TagName,Attribute(AttributeName,Is,AttributeValue),EndTag),
    CloseTag(StartCloseTag,TagName,EndTag)
  )
)

# Single brace at start of double-quoted attribute

<div attr="{a"></div>

==>

Document(
  Element(
    OpenTag(StartTag,TagName,Attribute(AttributeName,Is,AttributeValue),EndTag),
    CloseTag(StartCloseTag,TagName,EndTag)
  )
)

# Resolvable followed by single brace in attribute

<div attr="{{x}}{"></div>

==>

Document(
  Element(
    OpenTag(StartTag,TagName,Attribute(AttributeName,Is,AttributeValue(Resolvable)),EndTag),
    CloseTag(StartCloseTag,TagName,EndTag)
  )
)
