You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Returns an HTML string like 'See <a href="https://github.com/sindresorhus/dofle/issue/143">#143</a>'.
string
Type: string
A string with issue references to linkify.
options
Type: object
user
Required
Type: string
GitHub user.
repository
Required
Type: string
GitHub repository.
attributes
Type: object
HTML attributes to add to the link.
baseUrl
Type: string
Default: 'https://github.com'
The base URL.
additionalPrefix
Type: string | undefined
Default: 'GH-'
Additional reference prefix to support. It can be set to undefined to disable the default.
linkifyUrlsToHtml('Will not linkify GH-123',{additionalPrefix: undefined});// => 'Will not linkify GH-123'
linkifyUrlsToHtml('Will link SOUP:235 but not GH-123',{additionalPrefix: 'SOUP:'});// => 'Will link <a href="https://github.com/sindresorhus/dofle/issues/235">SOUP-235</a> but not GH-123'
Note
The prefix is added unescaped to the regex, keep it simple.
linkifyUrlsToDom(string, options)
Returns a DocumentFragment ready to be appended in a DOM safely, like DocumentFragment(TextNode('See '), HTMLAnchorElement('#143')).