No commit activity in last 3 years
No release in over 3 years
abbr tags are part of the html spec. They are currently not part of markdown but potentially part of common mark. In the mean time this adds abbr tags
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 5.3
~> 10.0
~> 0.8

Runtime

 Project Readme

Html::Pipeline::Abbr

This adds Abbreviation support to your html-pipeline.

Some implementations of Markdown support <abbr>, but it is not standard yet. It does look like [CommonMark] may include it. In the mean time, hope this helps.

Installation

Add this line to your application's Gemfile:

gem 'html-pipeline-abbr'

And then execute:

$ bundle

Or install it yourself as:

$ gem install html-pipeline-abbr

Usage

pipeline = HTML::Pipeline.new [
  HTML::Pipeline::MarkdownFilter,
  HTML::Pipeline::AbbrFilter,
]
result = pipeline.call <<-CODE
Lets generate some *great* HTML.

*[HTML]: Hypertext
CODE
puts result[:output].to_s

Prints:

<p>Lets generate some <strong>great</strong> <abbr title="Hypertxt">HTML</abbr>.</p>

On the flip side, there is also the AutoAbbrFilter which will find words that can be abbreviated and shorten them.

pipeline = HTML::Pipeline.new [
  HTML::Pipeline::MarkdownFilter,
  HTML::Pipeline::AutoAbbrFilter,
]
result = pipeline.call <<-CODE
Lets generate some *great* Hypertext.

*[HTML]: Hypertext
CODE
puts result[:output].to_s

It produces the same output:

<p>Lets generate some <strong>great</strong> <abbr title="Hypertxt">HTML</abbr>.</p>

Development

Thanks

Appreciated the sample tests and code from:

Contributing

  1. Fork it ( https://github.com/kbrock/html-pipeline-abbr/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request