|
@ -15,12 +15,6 @@ defmodule AutoLinker do |
|
|
|
|
|
|
|
|
iex> AutoLinker.link("google.com", new_window: false, rel: false, class: false) |
|
|
iex> AutoLinker.link("google.com", new_window: false, rel: false, class: false) |
|
|
~s(<a href="http://google.com">google.com</a>) |
|
|
~s(<a href="http://google.com">google.com</a>) |
|
|
|
|
|
|
|
|
iex> AutoLinker.link("[Google](http://google.com)", markdown: true, new_window: false, rel: false, class: false) |
|
|
|
|
|
~s(<a href='http://google.com'>Google</a>) |
|
|
|
|
|
|
|
|
|
|
|
iex> AutoLinker.link("[Google Search](http://google.com)", markdown: true) |
|
|
|
|
|
~s(<a href='http://google.com' class="auto-linker" target="_blank" rel="noopener noreferrer">Google Search</a>) |
|
|
|
|
|
""" |
|
|
""" |
|
|
|
|
|
|
|
|
import AutoLinker.Parser |
|
|
import AutoLinker.Parser |
|
@ -39,7 +33,6 @@ defmodule AutoLinker do |
|
|
* `exclude_class: false` - Set to a class name when you don't want urls auto linked in the html of the give class |
|
|
* `exclude_class: false` - Set to a class name when you don't want urls auto linked in the html of the give class |
|
|
* `exclude_id: false` - Set to an element id when you don't want urls auto linked in the html of the give element |
|
|
* `exclude_id: false` - Set to an element id when you don't want urls auto linked in the html of the give element |
|
|
* `exclude_patterns: ["```"]` - Don't link anything between the the pattern |
|
|
* `exclude_patterns: ["```"]` - Don't link anything between the the pattern |
|
|
* `markdown: false` - link markdown style links |
|
|
|
|
|
* `email: false` - link email links |
|
|
* `email: false` - link email links |
|
|
* `mention: false` - link @mentions (when `true`, requires `mention_prefix` or `mention_handler` options to be set) |
|
|
* `mention: false` - link @mentions (when `true`, requires `mention_prefix` or `mention_handler` options to be set) |
|
|
* `mention_prefix: nil` - a prefix to build a link for a mention (example: `https://example.com/user/`) |
|
|
* `mention_prefix: nil` - a prefix to build a link for a mention (example: `https://example.com/user/`) |
|
|