Sha256: 9dc7e60a3890abe37049ab0d058d70cebcaa7709c6f4d5ad08fb57bf29b84a42
Contents?: true
Size: 530 Bytes
Versions: 10
Compression:
Stored size: 530 Bytes
Contents
# frozen_string_literal: true module Stepmod module Utils module Converters class Sub < ReverseAdoc::Converters::Base def convert(node, state = {}) content = treat_children(node, state) return stem_notation(content) if state[:equation] "#{content[/^\s*/]}~#{content.strip}~#{content[/\s*$/]}" end private def stem_notation(content) "_{#{content}}" end end ReverseAdoc::Converters.register :sub, Sub.new end end end
Version data entries
10 entries across 10 versions & 1 rubygems