Class: Inversion::Template::StripTag

Inherits:
AttrTag
  • Object
show all
Includes:
Escaping
Defined in:
lib/inversion/template/striptag.rb

Overview

Inversion strip tag.

This tag strips markup from a template attribute.

Syntax

<?strip foo.bar ?>

Constant Summary collapse

HTML_TAG =
%r{
	<
		/?
		\p{Alnum}+
		(
			\s+
			\S+="[^\"]*"
		)*
		\s*
	>
}xi

Instance Method Summary collapse

Instance Method Details

#render(render_state) ⇒ Object

Render the method chains against the attributes of the specified render_state and return them.



35
36
37
38
# File 'lib/inversion/template/striptag.rb', line 35

def render( render_state )
	raw = super or return nil
	return raw.gsub(HTML_TAG, '')
end