Class: Arrow::HTMLText
Overview
Class for tokens output by Arrow::HTMLTokenizer for the text bits of an HTML document.
Instance Method Summary
-
- (Object) to_html
Return an HTML fragment that can be used to represent the token symbolically in a web-based introspection interface.
Methods inherited from HTMLToken
#css_class, #escape_html, #initialize
Methods inherited from Object
deprecate_class_method, deprecate_method, inherited
Methods included from Loggable
Constructor Details
This class inherits a constructor from Arrow::HTMLToken
Instance Method Details
- (Object) to_html
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 |