Skip to content

Commit a3615a9

Browse files
Release v1.0.13-beta.0
1 parent cfab602 commit a3615a9

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

lib/node/plugins/transformers/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import { usernameCompact, usernameExpand } from './username.js';
1+
import { mentionCompact, mentionExpand } from './mention.js';
22
import { pullRequestCompact, pullRequestExpand } from './pull-request.js';
33
import { compareCompact, compareExpand } from './compare.js';
44
import { commitCompact, commitExpand } from './commit.js';
55
const compact = [
6-
usernameCompact,
6+
mentionCompact,
77
pullRequestCompact,
88
compareCompact,
99
commitCompact
1010
];
1111
const expand = [
12-
usernameExpand,
12+
mentionExpand,
1313
pullRequestExpand,
1414
compareExpand,
1515
commitExpand
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import type { GitHubLinkifyTransformer } from '../../types/transformer.js';
2+
export declare const mentionCompact: GitHubLinkifyTransformer;
3+
export declare const mentionExpand: GitHubLinkifyTransformer;
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { regex } from '../regex.js';
22
import { template } from '../template.js';
33
import { url } from '../url.js';
4-
export const usernameCompact = (text, repo) => {
5-
const replacer = (value, item) => value.replace(item[0], template('username', item[1]));
4+
export const mentionCompact = (text, repo) => {
5+
const replacer = (value, item) => value.replace(item[0], template('mention', item[1]));
66
text = regex(text, /<\s*a.+@([a-zA-Z][\w\d\-_]*).+<\/\s*a\s*>/g, replacer);
77
text = regex(text, /\[[\s`@]*[\w\d\-]+[\s`]*]\(https:\/\/github\.com\/([\w\d\-]+)\/?\)/g, replacer);
88
text = regex(text, /@([a-zA-Z][\w\d\-_]*)/g, replacer);
99
return text;
1010
};
11-
export const usernameExpand = (text, repo) => {
11+
export const mentionExpand = (text, repo) => {
1212
const replacer = (value, item) => value.replace(item[0], url(repo, `@${item[1]}`, item[1]));
13-
text = regex(text, /::username::([\w\d\-_]+)::/g, replacer);
13+
text = regex(text, /::mention::([\w\d\-_]+)::/g, replacer);
1414
return text;
1515
};

lib/node/plugins/transformers/username.d.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vuepress-plugin-github-linkify",
3-
"version": "1.0.12",
3+
"version": "1.0.13-beta.0",
44
"description": "Fix display of GitHub links for Vuepress 2",
55
"author": {
66
"name": "Andrey Helldar",
@@ -33,7 +33,7 @@
3333
"module": "./lib/node/index.mts",
3434
"types": "./lib/node/index.d.ts",
3535
"files": [
36-
"lib"
36+
"lib/node"
3737
],
3838
"engines": {
3939
"node": ">=18.14"

0 commit comments

Comments
 (0)