content_news_summary.naml

<!-- Regex to capture the summary and its tags-->
<macro name="summary_regex">
	\s*\{summary_start\}.*\{summary_end\}\s*
</macro>

<!-- Regex with tags to be removed from the summary -->
<macro name="summary_cleanup_regex">
	<![CDATA[
	(\{summary_start\})|(\{summary_end\})|(<nabble_[^>]*>)
	]]>
</macro>

<override_macro name="root_post_message">
	<n.regex_replace_all. pattern="[n.summary_regex/]" replacement="">
		<n.overridden/>
	</n.regex_replace_all.>
</override_macro>

<override_macro name="search_result_message_fragment" requires="node,search">
	<n.regex_replace_all. pattern="[n.summary_regex/]" replacement="">
		<n.overridden/>
	</n.regex_replace_all.>
</override_macro>

<override_macro name="news_snippet_row" requires="node">
	<div class="node-snippet" style="padding:1em 0 .5em;clear:both">
		<n.set_var. name='message_text'><n.remove_html_tags.message.as_text/></n.set_var.>
		<n.regex text="[n.message.as_raw/]">
			<pattern.summary_regex/>
			<do>
				<n.if.find>
					<then>
						<n.regex_replace_all. pattern="[n.summary_cleanup_regex/]" replacement="">
							<n.found/>
						</n.regex_replace_all.>
					</then>
					<else>
						<n.truncate. size="300">
							<n.var name='message_text'/>
						</n.truncate.>
					</else>
				</n.if.find>
			</do>
		</n.regex>
		<n.news_snippet_read_more_link/>
	</div>
</override_macro>

<override_macro name="instant_text" requires="subscription,node_page" unindent="true">
	<n.regex_replace_all. pattern="[n.summary_regex/]" replacement="">
		<n.overridden/>
	</n.regex_replace_all.>
</override_macro>

<override_macro name="instant_html" requires="subscription,node_page">
	<n.regex_replace_all. pattern="[n.summary_regex/]" replacement="">
		<n.overridden/>
	</n.regex_replace_all.>
</override_macro>