diff --git a/src/main.js b/src/main.js index a2955702..86d47886 100644 --- a/src/main.js +++ b/src/main.js @@ -151,7 +151,7 @@ ${typeof x[1] === 'string' ? x[1] : JSON.stringify(x[1], null, 4)}` FrankerFaceZ.Logger = Logger; const VER = FrankerFaceZ.version_info = { - major: 4, minor: 2, revision: 4, + major: 4, minor: 2, revision: 5, commit: __git_commit__, build: __webpack_hash__, toString: () => diff --git a/src/modules/chat/tokenizers.jsx b/src/modules/chat/tokenizers.jsx index c0b10b4c..0d68c88b 100644 --- a/src/modules/chat/tokenizers.jsx +++ b/src/modules/chat/tokenizers.jsx @@ -13,7 +13,7 @@ import {TWITCH_EMOTE_BASE, REPLACEMENT_BASE, REPLACEMENTS} from 'utilities/const const EMOTE_CLASS = 'chat-image chat-line__message--emote', LINK_REGEX = /([^\w@#%\-+=:~])?((?:(https?:\/\/)?(?:[\w@#%\-+=:~]+\.)+[a-z]{2,6}(?:\/[\w./@#%&()\-+=:?~]*)?))([^\w./@#%&()\-+=:?~]|\s|$)/g, //MENTION_REGEX = /([^\w@#%\-+=:~])?(@([^\u0000-\u007F]+|\w+)+)([^\w./@#%&()\-+=:?~]|\s|$)/g; // eslint-disable-line no-control-regex - MENTION_REGEX = /^(['"*([{<\\/]*)(@)((?:[^\u0000-\u007F]|[\w-])+)/; // eslint-disable-line no-control-regex + MENTION_REGEX = /^(['"*([{<\\/]*)(@)((?:[^\u0000-\u007F]|[\w-])+)(?:\b|$)/; // eslint-disable-line no-control-regex // ============================================================================ @@ -232,7 +232,7 @@ export const Mentions = { display = null; mentionable = true; - regex = new RegExp(`^(['"*([{<\\/]*)(?:(@?)(${user.login.toLowerCase()}${display ? `|${display}` : ''})|@((?:[^\u0000-\u007F]|[\\w-])+))`, 'i'); + regex = new RegExp(`^(['"*([{<\\/]*)(?:(@?)(${user.login.toLowerCase()}${display ? `|${display}` : ''})|@((?:[^\u0000-\u007F]|[\\w-])+))(?:\\b|$)`, 'i'); } else regex = MENTION_REGEX; diff --git a/src/std-components/aspect.vue b/src/std-components/aspect.vue new file mode 100644 index 00000000..ba1c61af --- /dev/null +++ b/src/std-components/aspect.vue @@ -0,0 +1,12 @@ + \ No newline at end of file diff --git a/src/std-components/react-link.vue b/src/std-components/react-link.vue new file mode 100644 index 00000000..607cb475 --- /dev/null +++ b/src/std-components/react-link.vue @@ -0,0 +1,13 @@ + + + \ No newline at end of file diff --git a/src/utilities/vue.js b/src/utilities/vue.js index f363daf2..fbee5016 100644 --- a/src/utilities/vue.js +++ b/src/utilities/vue.js @@ -99,6 +99,16 @@ export class Vue extends Module { vue.mixin({ methods: { + reactNavigate(url, event) { + const router = t.resolve('site.router'); + if ( router && router.history ) { + if ( event ) { + event.preventDefault(); + event.stopPropagation(); + } + router.history.push(url); + } + }, t(key, phrase, options) { return this.$i18n.t_(key, phrase, options); },