mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-09 06:55:47 +01:00
unify name of ChangesetShortLink and export regex
This commit is contained in:
@@ -32,7 +32,7 @@ import MarkdownHeadingRenderer from "./MarkdownHeadingRenderer";
|
||||
import { create } from "./MarkdownLinkRenderer";
|
||||
import {useTranslation, WithTranslation, withTranslation} from "react-i18next";
|
||||
import Notification from "./Notification";
|
||||
import { createTransformer } from "./remarkCommitLinksParser";
|
||||
import { createTransformer } from "./remarkChangesetShortLinkParser";
|
||||
|
||||
type Props = RouteComponentProps & WithTranslation & {
|
||||
content: string;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
import { regExpPattern } from "./remarkCommitLinksParser";
|
||||
import { regExpPattern } from "./remarkChangesetShortLinkParser";
|
||||
|
||||
describe("Remark Commit Links RegEx Tests", () => {
|
||||
it("should match simple names", () => {
|
||||
@@ -30,7 +30,6 @@ import { TFunction } from "i18next";
|
||||
|
||||
const namePartRegex = nameRegex.source.substring(1, nameRegex.source.length - 1);
|
||||
|
||||
// Visible for testing
|
||||
export const regExpPattern = `(${namePartRegex})\\/(${namePartRegex})@([\\w\\d]+)`;
|
||||
|
||||
function match(value: string): RegExpMatchArray[] {
|
||||
@@ -45,7 +44,6 @@ function match(value: string): RegExpMatchArray[] {
|
||||
}
|
||||
|
||||
export const createTransformer = (t: TFunction): MdastPlugin => {
|
||||
|
||||
return (tree: MarkdownAbstractSyntaxTree) => {
|
||||
visit(tree, "text", (node: MarkdownAbstractSyntaxTree, index: number, parent: MarkdownAbstractSyntaxTree) => {
|
||||
if (parent.type === "link" || !node.value) {
|
||||
Reference in New Issue
Block a user