Sha256: 47081bd45ad90e1b764d6903a76803e086d3f7b11fd2d577f203d93317d967da

Contents?: true

Size: 328 Bytes

Versions: 30

Compression:

Stored size: 328 Bytes

Contents

class String
  def render_markdown(options = {})
    Nexmo::OAS::Renderer::MarkdownPipeline.new(options).call(self).html_safe
  end

  def unindent
    indent = squeeze("\n").lines.map { |line| line.index(/[^\s]/) }.compact.min || 0
    gsub(/^[[:blank:]]{#{indent}}/, '')
  end

  def unindent!
    replace(unindent)
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
nexmo-oas-renderer-0.7.1 lib/nexmo/oas/renderer/lib/core_ext/string.rb
nexmo-oas-renderer-0.7.0 lib/nexmo/oas/renderer/lib/core_ext/string.rb
nexmo-oas-renderer-0.6.6 lib/nexmo/oas/renderer/lib/core_ext/string.rb
nexmo-oas-renderer-0.6.5 lib/nexmo/oas/renderer/lib/core_ext/string.rb
nexmo-oas-renderer-0.6.4 lib/nexmo/oas/renderer/lib/core_ext/string.rb
nexmo-oas-renderer-0.6.3 lib/nexmo/oas/renderer/lib/core_ext/string.rb
nexmo-oas-renderer-0.6.2 lib/nexmo/oas/renderer/lib/core_ext/string.rb
nexmo-oas-renderer-0.6.1 lib/nexmo/oas/renderer/lib/core_ext/string.rb
nexmo-oas-renderer-0.5.6 lib/nexmo/oas/renderer/lib/core_ext/string.rb
nexmo-oas-renderer-0.5.5 lib/nexmo/oas/renderer/lib/core_ext/string.rb
nexmo-oas-renderer-0.5.4 lib/nexmo/oas/renderer/lib/core_ext/string.rb
nexmo-oas-renderer-0.5.2 lib/nexmo/oas/renderer/lib/core_ext/string.rb
nexmo-oas-renderer-0.5.1 lib/nexmo/oas/renderer/lib/core_ext/string.rb
nexmo-oas-renderer-0.5.0 lib/nexmo/oas/renderer/lib/core_ext/string.rb
nexmo-oas-renderer-0.4.1 lib/nexmo/oas/renderer/lib/core_ext/string.rb
nexmo-oas-renderer-0.4.0 lib/nexmo/oas/renderer/lib/core_ext/string.rb
nexmo-oas-renderer-0.3.7 lib/nexmo/oas/renderer/lib/core_ext/string.rb
nexmo-oas-renderer-0.3.6 lib/nexmo/oas/renderer/lib/core_ext/string.rb
nexmo-oas-renderer-0.3.5 lib/nexmo/oas/renderer/lib/core_ext/string.rb
nexmo-oas-renderer-0.3.4 lib/nexmo/oas/renderer/lib/core_ext/string.rb