README.md in crazy_harry-0.1.2 vs README.md in crazy_harry-0.2.0
- old
+ new
@@ -32,11 +32,11 @@
end
end
## Default Actions
-It automatically removes blank tags, converts `<br \>` tags to wrapped
+It automatically removes blank tags, converts `<br />` tags to wrapped
paragraphs and de-dupes content.
## Chaining
As per the previous example, all calls **except** `.strip!` (which removes
@@ -104,9 +104,25 @@
The `.foster!` command will wrap orphaned li tags in a ul tag. **This
only works for li tag for now.**
CrazyHarry.fragment('<li>Flying list tag</li>').foster!.to_s
+
+will return:
+
+ <ul><li>Flying list tag</li></ul>
+
+## Truncating
+
+The `.truncate!` command will truncate input preserving HTML tags.
+
+ CrazyHarry.fragment( '<p>Long <b>text goes here</b></p>' ).truncate!(3)
+
+will return
+
+ <p>Long <b>text goes</b>…</p>
+
+It accepts hash of options and passes it to [HTML_Truncator](https://github.com/nono/HTML-Truncator). It returns self and can be chained with other commands.
## Known Issues/TODO
* De-duping does not take account of whitespace. So, `<p>Some Content</p>` and `<p>Some Content </p>` will not be treated as duplicates.
* Be able to turn off default actions.