Sha256: cae439462b4dbe7dfd7be2abff2205a331bbd6347b5dedbbceb4d416325b33a9

Contents?: true

Size: 446 Bytes

Versions: 10

Compression:

Stored size: 446 Bytes

Contents

require_relative 'annotation'

require 'pathname'

module SSMD::Annotations
  class SubstitutionAnnotation < Annotation
    attr_reader :text_alias

    def self.regex
      /sub: ?(.+)/
    end

    def initialize(text_alias)
      @text_alias = text_alias
    end

    def wrap(text)
      "<sub alias=\"#{text_alias}\">#{text}</sub>"
    end

    def combine(annotation)
      self # discard further substitution annotations
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ssmd-0.7.6 lib/ssmd/annotations/substitution_annotation.rb
ssmd-0.7.5 lib/ssmd/annotations/substitution_annotation.rb
ssmd-0.7.4 lib/ssmd/annotations/substitution_annotation.rb
ssmd-0.7.3 lib/ssmd/annotations/substitution_annotation.rb
ssmd-0.7.2 lib/ssmd/annotations/substitution_annotation.rb
ssmd-0.7.1 lib/ssmd/annotations/substitution_annotation.rb
ssmd-0.7.0 lib/ssmd/annotations/substitution_annotation.rb
ssmd-0.6.1 lib/ssmd/annotations/substitution_annotation.rb
ssmd-0.6.0 lib/ssmd/annotations/substitution_annotation.rb
ssmd-0.5.0 lib/ssmd/annotations/substitution_annotation.rb