
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
As of version 3, Rails doesn't have the textilize
,
textilize_without_paragraph
, and markdown
helper methods. Formatize brings
them back. Drop it into the old application you're upgrading and it'll smoothen
the process just that little bit more.
Put gem 'formatize'
into your Gemfile and do a bundle install
, and that's
it. Formatize depends on RedCloth
and bluecloth
so you will not have to
worry about those.
textilize
& textilize_without_paragraph
helper methodsThe textilize
helper method accepts a string of
Textile and one or more flags. Often, the
default behavior will be suitable and you will not have to pass it any flags:
textilize("*This is Textile!* Rejoice!")
# => "<p><strong>This is Textile!</strong> Rejoice!</p>"
When necessary, flags are listed as such:
textilize("(snip)", :flag1, :flag2, :flag3)
# => "(snip)"
The RedCloth
documentation
lists the available flags. The textilize_without_paragraph
method
delegates to textilize
but strips the surrounding <p>
tags.
markdown
helper methodThe markdown
helper method accepts a string of
Markdown and one or more
flags. Often, the default behavior will be suitable and you will not have
to pass it any flags:
markdown("We are using __Markdown__ now!")
# => "<p>We are using <strong>Markdown</strong> now!</p>"
When necessary, flags are listed as such:
markdown("(snip)", :flag1, :flag2, :flag3)
# => "(snip)"
The bluecloth
documentation
lists the available flags.
Both textilize
and markdown
sanitizes the input using Rails'
sanitize
prior to parsing. Since both gems can do this themselves,
it's useful to be able to bypass the pre-parsing sanitization. Two ways:
:safe
flag, which is not passed on to the parser.
(Deprecated in 1.1, removed in 2.0).With Rails' sanitize
, if you don't bypass it, you can choose which tags and
attributes to allow as described in the
documentation.
Feel free to try other versions. Minor patches to support other versions are welcome.
Latest versions in the 1.8 and 1.9 series. Generally, Formatize will not jump through hoops to support other versions. 1.8 support may be dropped eventually.
The latest versions in all the 3.0 series. This is likely to change when 4.0 is released.
RedCloth
gembluecloth
gemCopyright (c) 2012 David Trasbo
Released under the MIT License. See LICENSE for details.
FAQs
Unknown package
We found that formatize demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.