Skip to content

Add an option to only linkify URLs that start with a scheme#19

Open
hubgit wants to merge 1 commit intomisd-service-development:masterfrom
hubgit:patch-1
Open

Add an option to only linkify URLs that start with a scheme#19
hubgit wants to merge 1 commit intomisd-service-development:masterfrom
hubgit:patch-1

Conversation

@hubgit
Copy link

@hubgit hubgit commented Dec 21, 2016

Adding a require_scheme option allows a user to disable auto-linking of things that look like URLs (e.g. www.example.com), so that only full URLs (e.g. https://www.example.com) are auto-linked. The scheme currently has to match ~^(ht|f)tps?://~.

Example usage:

$html = $linkify->processUrls($html, [
  'require_scheme' => true
]);

Adding a `require_scheme` option allows a user to disable auto-linking of `www.example.com`, so that only full URLs (e.g. `https://www.example.com` are auto-linked. The scheme currently has to match `~^(ht|f)tps?://~`.

Example usage:
```php
$html = $linkify->processUrls($html, [
  'require_scheme' => true
]);
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant