logo

auto_linker

AutoLinker-shim, based on https://git.pleroma.social/pleroma/auto_linker
commit: e8470008ec017295cacdba31578b85bb4c83aeb9
parent: b2dd560888316e33495ab599ae6973cf23fcf6a9
Author: Egor Kislitsyn <egor@kislitsyn.com>
Date:   Fri,  8 Feb 2019 19:28:38 +0700

fix readme examples

Diffstat:

MREADME.md14++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md @@ -27,6 +27,7 @@ end The following examples illustrate some examples on how to use the auto linker. +```iex iex> AutoLinker.link("google.com") "<a href='http://google.com' class='auto-linker' target='_blank' rel='noopener noreferrer'>google.com</a>" @@ -36,17 +37,18 @@ iex> AutoLinker.link("google.com", new_window: false, rel: false) iex> AutoLinker.link("google.com", new_window: false, rel: false, class: false) "<a href='http://google.com'>google.com</a>" -iex> AutoLinker.link("call me at x9999") -~s{call me at <a href="" class="phone-number" data-number="9999">x9999</a>} +iex> AutoLinker.link("call me at x9999", phone: true) +"call me at <a href=\"#\" class=\"phone-number\" data-phone=\"9999\">x9999</a>" -iex> AutoLinker.link("or at home on 555.555.5555") -~s{or at home on <a href="" class="phone-number" data-number="55555555555">555.555.5555</a>} +iex> AutoLinker.link("or at home on 555.555.5555", phone: true) +"or at home on <a href=\"#\" class=\"phone-number\" data-phone=\"5555555555\">555.555.5555</a>" -iex> AutoLinker.link(", work (555) 555-5555") -~s{, work <a href="" class="phone-number" data-number="5555555555">(555) 555-5555</a>} +iex> AutoLinker.link(", work (555) 555-5555", phone: true) +", work <a href=\"#\" class=\"phone-number\" data-phone=\"5555555555\">(555) 555-5555</a>" iex> AutoLinker.link("[Google Search](http://google.com)", markdown: true) "<a href='http://google.com' class='auto-linker' target='_blank' rel='noopener noreferrer'>Google Search</a>" +``` See the [Docs](https://hexdocs.pm/auto_linker/) for more examples