Sha256: a1116290f68eadb2ab6d17f6ae09c97c2cae27e87230533d1d7817759e9fc7d5

Contents?: true

Size: 296 Bytes

Versions: 8

Compression:

Stored size: 296 Bytes

Contents

module MiniSyntax
  module Highlighter
    module YAML
      def self.highlight(code)
        code.gsub! /^(  )*([a-z_-]+:)/, "\\1<b>\\2</b>"
        code.gsub! /(\#([^\{].*?)?)\n/, "<i>\\1</i>\n"
        code
      end
    end
  end
end

MiniSyntax.register(:yaml, MiniSyntax::Highlighter::YAML)

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
minisyntax-0.2.5 lib/minisyntax/highlighter/yaml.rb
minisyntax-0.2.4 lib/minisyntax/highlighter/yaml.rb
minisyntax-0.2.3 lib/minisyntax/highlighter/yaml.rb
minisyntax-0.2.2 lib/minisyntax/highlighter/yaml.rb
minisyntax-0.2.1 lib/minisyntax/highlighter/yaml.rb
minisyntax-0.2.0 lib/minisyntax/highlighter/yaml.rb
minisyntax-0.1.2 lib/minisyntax/highlighter/yaml.rb
minisyntax-0.1.1 lib/minisyntax/highlighter/yaml.rb