<commit_before>###
# 
###
SpViewBuilder = (ContentBlockService, builder) ->
	builder.build = ($routeParams) ->
		blocks = []
		compile = () ->
			blocks.reverse()
			template = blocks[0].body
			blocks = blocks[1..-1]
			angular.forEach blocks, (block) ->
				template = template.replace("<sp-yield></sp-yield>", block.body)
			template
		ContentBlockService.find_by_slug($routeParams.slug)
			.then (block) ->
				blocks.push(block)
				if block.layout_block_id?
					ContentBlockService.find(block.layout_block_id)
					.then (layout) ->
						block = layout
						blocks.push(layout)
						if block.layout_block_id?
							ContentBlockService.find(block.layout_block_id)
							.then (layout) ->
								block = layout
								blocks.push(layout)
								compile()
						else
							compile()
		
	service = 
		builder: builder<commit_msg>Allow for limitless nesting of layouts<commit_after>###
# 
###
SpViewBuilder = (ContentBlockService, builder) ->
	builder.build = ($routeParams) ->
		blocks = []
		compile = () ->
			blocks.reverse()
			template = blocks[0].body
			blocks = blocks[1..-1]
			angular.forEach blocks, (block) ->
				template = template.replace("<sp-yield></sp-yield>", block.body)
			template
		getLayout = (layout_block_id) ->
			ContentBlockService.find(layout_block_id)
				.then (layout) ->
					block = layout
					blocks.push(layout)
					if block.layout_block_id?
						getLayout(block.layout_block_id)

		ContentBlockService.find_by_slug($routeParams.slug)
			.then (block) ->
				blocks.push(block)
				if block.layout_block_id?
					getLayout(block.layout_block_id)
						.then ->
							compile()
				else
					compile()
		
	service = 
		builder: builder
{'fraction_non_alphanumeric': 0.13515115589804386, 'fraction_numerical': 0.0035566093657379964, 'mean_word_length': 2.925581395348837, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5528837', 'n_tokens_mistral': 705, 'n_tokens_neox': 533, 'n_words': 95}