Nested template scopes not working

Hi there,

I’m having problems handling an edge case where my subsyntax “container” (template) has another template tag nested inside.

As you can see the nested </template is captured from the regex and the code beneath is not treated as the subsyntax vue-html that the template tag provides.

This is the code of the template tag

<scope name="vue.embedded.block.template" spell-check="false" lookup="documentation">
	<starts-with>
		<expression>(?=&lt;(?i:template)\b)</expression>
	</starts-with>
	<ends-with>
		<expression>(?=&lt;/(?i:template)\b)</expression>
	</ends-with>
	<subscopes>
		<scope name="vue.tag.template.open">
			<symbol type="tag-style">
				<context behavior="start" group-by-name="true">
					<auto-close string="&lt;/" completion="${name}&gt;" />
				</context>
			</symbol>
			<starts-with>
				<expression>&lt;((?i:template))</expression>
				<capture number="1" name="vue.tag.name" />
			</starts-with>
			<ends-with>
				<expression>/?&gt;</expression>
			</ends-with>
			<subscopes>
				<include syntax="vue-html" collection="vue-directives" />
				<include syntax="html" collection="attributes" />
			</subscopes>
		</scope>
		<scope name="vue.embedded.block.template.content">
			<starts-with>
				<expression>(?&lt;=&gt;)</expression>
			</starts-with>
			<ends-with>
				<expression>(?=&lt;/(?i:template)\b)</expression>
			</ends-with>
			
			<subsyntax name="vue-html" noncontiguous="true">
				<cut-off>
					<expression>(?=&lt;/(?i:template)\b)</expression>
				</cut-off>
			</subsyntax>
		</scope>
	</subscopes>
</scope>

How can I handle this? Thanks

I’ve found a solution, thanks anyway.

1 Like

Glad to hear you got it working (and sorry I didn’t get to this faster!) If you have any other issues around this, let us know!

1 Like