Skip to content

Commit

Permalink
More error-tolerant link matching (#777)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyanzhong authored Nov 25, 2024
1 parent 24d01e4 commit ca365d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CoreEditor/src/styling/nodes/link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { isReleaseMode } from '../../common/utils';
import { isMetaKeyDown } from '../../modules/events';

// Fragile approach, but we only use it for link clicking, it should be fine
const regexp = /[a-zA-Z][a-zA-Z0-9+.-]*:\/\/\/?(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}(\.)?[a-z]{2,16}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)|(\[.*?\]\()(.+?)[\s)]/g;
const regexp = /[a-zA-Z][a-zA-Z0-9+.-]*:\/\/\/?([a-zA-Z0-9-]+\.)?[-a-zA-Z0-9@:%._+~#=]+(\.[a-z]+)?\b([-a-zA-Z0-9@:%._+~#=?&//]*)|(\[.*?\]\()(.+?)[\s)]/g;
const className = 'cm-md-link';

declare global {
Expand Down

0 comments on commit ca365d0

Please sign in to comment.