Class: Arrow::HTMLText

Inherits:
HTMLToken show all
Defined in:
lib/arrow/htmltokenizer.rb

Overview

Class for tokens output by Arrow::HTMLTokenizer for the text bits of an HTML document.

Instance Attribute Summary

Attributes inherited from HTMLToken

#raw

Instance Method Summary collapse

Methods inherited from HTMLToken

#css_class, #escape_html, #initialize

Methods inherited from Object

deprecate_class_method, deprecate_method, inherited

Constructor Details

This class inherits a constructor from Arrow::HTMLToken

Instance Method Details

#to_htmlObject

Return an HTML fragment that can be used to represent the token symbolically in a web-based introspection interface.



167
168
169
170
171
172
173
# File 'lib/arrow/htmltokenizer.rb', line 167

def to_html
	marked = self.escape_html( @raw )
	marked.gsub( /(&[^;]+;)/ ) {|ent|
		%Q{<span class="entity">#{ent}</span>}
	}
	super { marked  }
end