Module: ArticleJSON::Export::Common::HTML::Elements::Text

Included in:
AMP::Elements::Text, AppleNews::Elements::Quote, AppleNews::Elements::Text, FacebookInstantArticle::Elements::Text, HTML::Elements::Text
Defined in:
lib/article_json/export/common/html/elements/text.rb

Instance Method Summary collapse

Instance Method Details

#exportNokogiri::XML::NodeSet

Generate a Nokogiri node or simple text node, depending on the text options

Returns:

  • (Nokogiri::XML::NodeSet)


10
11
12
13
14
15
# File 'lib/article_json/export/common/html/elements/text.rb', line 10

def export
  return bold_and_italic_node if @element.bold && @element.italic
  return bold_node if @element.bold
  return italic_node if @element.italic
  content_node
end