Class: Qti::V1::Models::Base

Inherits:
Models::Base show all
Defined in:
lib/qti/v1/models/base.rb

Constant Summary

Constants inherited from Models::Base

Models::Base::ELEMENTS_REMAP

Instance Attribute Summary

Attributes inherited from Models::Base

#doc, #manifest, #package_root, #path

Instance Method Summary collapse

Methods inherited from Models::Base

#css_with_single_check, from_path!, #initialize, #object_tag_transformer, #parse_html, #parse_xml, #preprocess_xml_doc, #remap_href_path, #remap_unknown_tags_transformer, #sanitize_config, #sanitize_content!, #xpath_with_single_check

Constructor Details

This class inherits a constructor from Qti::Models::Base

Instance Method Details

#qti_versionObject



7
8
9
# File 'lib/qti/v1/models/base.rb', line 7

def qti_version
  1
end

#return_inner_content!(node) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/qti/v1/models/base.rb', line 11

def return_inner_content!(node)
  if node.attributes['texttype']&.value == 'text/plain' ||
     node.child.cdata? || node.inner_html.include?('&gt' || '&lt')
    node.text
  else
    node.inner_html
  end
end