Space out your stache

These find/replace scripts:

\{\{([^ #\/\^!]) -> {{ $1
\{\{([#\/\^!])([^ ]) -> {{$1 $2
([^ ])\}\} -> $1 }}

space out your stache to look more like:

{{# if(app.session) }}
	{{# if(app.session.isAdmin) }}
		<li {{# is(app.page, 'users') }}class='active'{{/ is }}>
			<a href="{{ routeUrl(page='users') }}">Users</a>
		</li>
	{{/ if }}
	<li {{# is(app.page, 'account') }}class='active'{{/ is }}>
		<a href="{{ routeUrl(page='account') }}">Account</a>
	</li>
	<li>
		<a href="javascript://" on:click="scope.vm.logout()">Logout</a>
	</li>
{{ else }}

If that’s what you are into

1 Like

This regexp can help you find helper expressions: \{\{\s*([#\/\^])\s*\w+\s+[\w\.]+

This regexp can find {{#each(foo bar=value)}}: \{\{([#\/\^!])\s*each\(\s*[\w\.]+\s[\w\.]+