Open hankor opened 8 years ago
The regex used in layoutUtil to determine the layout name/path seems to be too greedy. If there is another quote followed by a closing bracket somewhere in the page, it'll take the whole text up to that quote as the layout name.
On a page like this for example:
@layout("Layout/Standard.html"); <div>Some content</div> <script> $("#button").click(function() { alert("test"); }); </script>
it would determine
Layout/Standard.html"); <div>Some content</div> <script> $("#button").click(function() { alert("test
as the layout name.
This regex works a lot better for me:
new RegExp(symbol + "layout\\([\\s]*[\"\']{1}([^\"\']*)[\"\']{1}[\\s]*\\);", 'gi')
The regex used in layoutUtil to determine the layout name/path seems to be too greedy. If there is another quote followed by a closing bracket somewhere in the page, it'll take the whole text up to that quote as the layout name.
On a page like this for example:
it would determine
as the layout name.
This regex works a lot better for me: