mirror of
https://github.com/plankanban/planka.git
synced 2025-08-02 20:15:27 +02:00
ref: Little refactoring
This commit is contained in:
parent
585464eef3
commit
63de346b0e
8 changed files with 42 additions and 28 deletions
|
@ -13,7 +13,7 @@ import { Button } from 'semantic-ui-react';
|
|||
|
||||
import selectors from '../../../selectors';
|
||||
import entryActions from '../../../entry-actions';
|
||||
import { formatTextWithMentions } from '../../../utils/formatters';
|
||||
import { formatTextWithMentions } from '../../../utils/mentions';
|
||||
import Paths from '../../../constants/Paths';
|
||||
import { StaticUserIds } from '../../../constants/StaticUsers';
|
||||
import { NotificationTypes } from '../../../constants/Enums';
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
|
||||
*/
|
||||
|
||||
const MENTION_REGEX = /@\[(.*?)\]\((.*?)\)/g;
|
||||
import { MENTION_REGEX } from '../../utils/mentions';
|
||||
|
||||
export default (md) => {
|
||||
md.core.ruler.push('mention', ({ tokens }) => {
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
const MENTIONS_REGEX = /@\[(.*?)\]\(.*?\)/g;
|
||||
|
||||
// eslint-disable-next-line import/prefer-default-export
|
||||
export const formatTextWithMentions = (text) => text.replace(MENTIONS_REGEX, '@$1');
|
9
client/src/utils/mentions.js
Normal file
9
client/src/utils/mentions.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
/*!
|
||||
* Copyright (c) 2024 PLANKA Software GmbH
|
||||
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
|
||||
*/
|
||||
|
||||
export const MENTION_REGEX = /@\[(.*?)\]\((.*?)\)/g;
|
||||
export const MENTION_NAME_REGEX = /@\[(.*?)\]\(.*?\)/g;
|
||||
|
||||
export const formatTextWithMentions = (text) => text.replace(MENTION_NAME_REGEX, '@$1');
|
Loading…
Add table
Add a link
Reference in a new issue