module Asciidoctor::Substitutors

def expand_subs subs, subject = nil

Returns a Symbol Array of substitutions to pass to apply_subs or nil if no substitutions were resolved.

subject - The String to use in log messages to communicate the subject for which subs are being resolved (default: nil)
subs - The substitutions to expand; can be a Symbol, Symbol Array, or String

Public: Expand all groups in the subs list and return. If no subs are resolved, return nil.
def expand_subs subs, subject = nil
  case subs
  when ::Symbol
    subs == :none ? nil : SUB_GROUPS[subs] || [subs]
  when ::Array
    expanded_subs = []
    subs.each do |key|
      unless key == :none
        if (sub_group = SUB_GROUPS[key])
          expanded_subs += sub_group
        else
          expanded_subs << key
        end
      end
    end
    expanded_subs.empty? ? nil : expanded_subs
  else
    resolve_subs subs, :inline, nil, subject
  end
end