This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 827
linkify vector.im URLs directly into the app, both from HTML and non-HTML messages #235
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// as if someone explicitly links to vector.im/develop and we're on vector.im/beta | ||
// they may well be trying to get us to explicitly go to develop. | ||
// FIXME: intercept matrix.to URLs as well. | ||
matrixLinkify.VECTOR_URL_PATTERN = "(https?:\/\/)?" + escapeRegExp(window.location.host + window.location.pathname); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could do with a leading ^
@richvdh excellent review - thanks; ptal |
return { tagName: 'a', attribs: { href: attribs.href, name: attribs.name } }; | ||
} | ||
else { | ||
return { tagName: 'a', attribs: { href: attribs.href, name: attribs.name, target: '_blank' } }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be preferable to modify attribs['target']
in-place (as simpleTransform
does) rather than hardcode a list of attributes which we preserve? Can argue this both ways though.
lgtm modulo minor thought |
ara4n
added a commit
that referenced
this pull request
Mar 21, 2016
linkify vector.im URLs directly into the app, both from HTML and non-HTML messages
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.