Skip to content

2.1.1

Latest
Compare
Choose a tag to compare
@alexcorvi alexcorvi released this 08 May 13:08
· 100 commits to gh-pages since this release

Improvements & New features

  • The list options is exposing a lot more information about the listed token.
  • conditional options (those options parameters that passes a function as the value) are receiving a second argument now, exposing a lot more information about the token.
// for all tokens
export interface BaseTokenProps {
	start: number;
	end: number;
	string: string;
	reason: string; // could be "url", "email", "file"
}

// for emails tokens
export interface Email extends BaseTokenProps {
	isEmail: true;
	protocol: string;
	local: string;
	host: string;
}

// for URL token
export interface URL extends BaseTokenProps {
	isURL: true;
	protocol: string;
	host: string;
	port: string;
	ipv4: string;
	ipv6: string;
	confirmedByProtocol: boolean;
	path: string;
	query: string;
	fragment: string;
}

// for file tokens
export interface File extends BaseTokenProps {
	isFile: true;
	filename: string;
	filePath: string;
	fileDirectory: string;
}

Bug fixes

  • Fixed bug where the library doesn't count slashes at the end. (#71)
  • Fixed a bug where the library breaks HTML if a non-standard attribute had a link (#76 #72).
  • Fixed a bug where the library breaks inline styling if it had a link (#75)