Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib add html_safe
test
.gitignore
.travis.yml
Gemfile
README.md
Rakefile
zfben_extend.gemspec

README.md

zfben_extend

A tool to extend ruby string.

Build Status

Install

gem 'zfben_extend'

Use

  ZfbenExtend::String.to_html('text http://link #tag mail@mail.com @user text', tag_url: '/tagurl/', user_url: '/userurl/')
  # => 'text <a href="http://link">http://link</a> <a href="/tagurl/tag">#tag</a> <a href="mailto:mail@mail.com">mail@mail.com</a> <a href="/userurl/user">@user</a> text'

  ZfbenExtend::String.to_cnbr('a.b', chars: /\./, br: '<hr />')
  # => 'a.<hr />b'

  ZfbenExtend::String.markdown('    a')
  # => <div class=\"CodeRay\">\n  <div class=\"code\"><pre>a\n</pre></div>\n</div>\n

  ZfbenExtend::String.markdown("```ruby\n    a\n```")
  # => <div class=\"CodeRay\">\n  <div class=\"code\"><pre>    a\n</pre></div>\n</div>\n

See more at https://github.com/benz303/zfben_extend/blob/master/test/string_test.rb

Something went wrong with that request. Please try again.