fix: Add support for mm.tt mindmeister links
This commit is contained in:
@@ -3,7 +3,7 @@ import * as React from 'react';
|
||||
import Frame from './components/Frame';
|
||||
|
||||
const URL_REGEX = new RegExp(
|
||||
'^https://([w.-]+.)?mindmeister.com(/maps/public_map_shell)?/(\\d+)(/.*)?$'
|
||||
'^https://([w.-]+.)?(mindmeister.com|mm.tt)(/maps/public_map_shell)?/(\\d+)(\\?t=.*)?(/.*)?$'
|
||||
);
|
||||
|
||||
type Props = {
|
||||
@@ -15,7 +15,7 @@ export default class Mindmeister extends React.Component<Props> {
|
||||
static ENABLED = [URL_REGEX];
|
||||
|
||||
render() {
|
||||
const chartId = this.props.matches[3];
|
||||
const chartId = this.props.matches[4] + this.props.matches[6];
|
||||
|
||||
return (
|
||||
<Frame
|
||||
|
||||
@@ -5,6 +5,15 @@ const { Mindmeister } = embeds;
|
||||
|
||||
describe('Mindmeister', () => {
|
||||
const match = Mindmeister.ENABLED[0];
|
||||
|
||||
test('to be enabled on mm.tt link', () => {
|
||||
expect('https://mm.tt/326377934'.match(match)).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to be enabled on mm.tt link with token parameter', () => {
|
||||
expect('https://mm.tt/326377934?t=r9NcnTRr18'.match(match)).toBeTruthy();
|
||||
});
|
||||
|
||||
test('to be enabled on embed link', () => {
|
||||
expect(
|
||||
'https://www.mindmeister.com/maps/public_map_shell/326377934/paper-digital-or-online-mind-mapping'.match(
|
||||
|
||||
@@ -3,7 +3,7 @@ import * as React from 'react';
|
||||
import Frame from './components/Frame';
|
||||
|
||||
const URL_REGEX = new RegExp(
|
||||
'https://([w.-]+.)?modeanalytics.com/(.*)/reports/(.*)$'
|
||||
'^https://([w.-]+.)?modeanalytics.com/(.*)/reports/(.*)$'
|
||||
);
|
||||
|
||||
type Props = {
|
||||
|
||||
Reference in New Issue
Block a user