Skip to content

"Greedy" link detection surrounded by angle brackets #171

@texastoland

Description

@texastoland

My https://github.com/platers/obsidian-linter is configured to wrap bare links like <https://github.com/platers/obsidian-linter>. The current regex consumes the closing angle bracket and appends %3E:

export const matchRegexp = /(?<!]\()https:\/\/github\.com\/[^\s]+(?<!['".?,:;]+)/g;

I think an improvement would be to consume valid characters instead of terminating on invalid ones:

/(?<!]\()https:\/\/github\.com\/[\w#-/!:;=?@[\]]+/g

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions