Sha256: 34196cd199e1a9db1c7a1449b3d240f5f83dd3aed0a2e4dbd8b591a84c44d089

Contents?: true

Size: 872 Bytes

Versions: 2

Compression:

Stored size: 872 Bytes

Contents

# frozen_string_literal: true

module Plurimath
  module Math
    class Core
      def class_name
        self.class.name.split("::").last.downcase
      end

      def insert_t_tag
        Array(to_omml_without_math_tag)
      end

      def tag_name
        "subsup"
      end

      def nary_attr_value
        ""
      end

      def empty_tag(wrapper_tag)
        r_tag = Utility.ox_element("r", namespace: "m")
        r_tag << (Utility.ox_element("t", namespace: "m") << "&#8203;")
        wrapper_tag << r_tag
      end

      def omml_parameter(field, tag_name: , namespace: "m")
        tag = Utility.ox_element(tag_name, namespace: namespace)
        return empty_tag(tag) unless field

        Utility.update_nodes(
          tag,
          field&.insert_t_tag,
        )
      end

      def validate_function_formula
        true
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
plurimath-0.3.7 lib/plurimath/math/core.rb
plurimath-0.3.6 lib/plurimath/math/core.rb