Method: ArticleJSON::Import::GoogleDoc::HTML::TextParser#content
- Defined in:
- lib/article_json/import/google_doc/html/text_parser.rb
#content ⇒ String
The content of the text node, w/o any markup
15 16 17 18 19 20 |
# File 'lib/article_json/import/google_doc/html/text_parser.rb', line 15 def content @node.children .map { |child| child.name == 'br' ? "\n" : child.inner_text } .join('') .gsub(/\s*\n\s*/, "\n") # Only keep a single consecutive linebreak end |