Skip to content

Commit

Permalink
chore: 🤖 rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Saul-Mirone committed Sep 5, 2022
1 parent 578f6e7 commit a92384a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/preset-commonmark/src/plugin/inline-sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const inlineSyncConfigCtx = createSlice<inlineSyncConfig, 'inlineSyncConf

const linkRegexp = /\[(?<span>((www|https:\/\/|http:\/\/)\S+))]\((?<url>\S+)\)/;

const regexp = (holePlaceholder: string) => new RegExp(`\\\\(?=[^\\w\\s${holePlaceholder}\\\\]|_)`, 'g');
const punctuationRegexp = (holePlaceholder: string) => new RegExp(`\\\\(?=[^\\w\\s${holePlaceholder}\\\\]|_)`, 'g');

const keepLink = (str: string) => {
let text = str;
Expand All @@ -83,7 +83,8 @@ const swap = (text: string, first: number, last: number) => {
};

const removeLf = (text: string) => text.slice(0, -1);
const replacePunctuation = (holePlaceholder: string) => (text: string) => text.replace(regexp(holePlaceholder), '');
const replacePunctuation = (holePlaceholder: string) => (text: string) =>
text.replace(punctuationRegexp(holePlaceholder), '');

const calculatePlaceholder = (placeholder: SyncNodePlaceholder) => (text: string) => {
const index = text.indexOf(placeholder.hole);
Expand Down

1 comment on commit a92384a

@vercel
Copy link

@vercel vercel bot commented on a92384a Sep 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.