How to use the linkify-it.prototype function in linkify-it

To help you get started, we’ve selected a few linkify-it examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github thelounge / thelounge / client / js / helpers / ircmessageparser / findLinks.js View on Github external
"use strict";

const LinkifyIt = require("linkify-it");

LinkifyIt.prototype.normalize = function normalize(match) {
	if (!match.schema) {
		match.schema = "http:";
		match.url = "http://" + match.url;
	}

	if (match.schema === "//") {
		match.schema = "http:";
		match.url = "http:" + match.url;
	}

	if (match.schema === "mailto:" && !/^mailto:/i.test(match.url)) {
		match.url = "mailto:" + match.url;
	}
};

const linkify = LinkifyIt()

linkify-it

Links recognition library with FULL unicode support

MIT
Latest version published 1 year ago

Package Health Score

67 / 100
Full package analysis