Skip to content

Exclude trailing punctuation from linkified URLs in the timeline #95

Closed

Description

@iamnbutler

A sent message containing https://github.com/githubnext/ace2/issues/91: attach images… renders a link to https://github.com/githubnext/ace2/issues/91:, including the colon. Following the link opens the wrong URL.

Cause

The timeline parses message text with comark (packages/ui/src/components/blocks/parse.ts), whose autolinking keeps a trailing colon:

"Implement https://github.com/githubnext/ace2/issues/91: attach"
-> ["a",{"href":"https://github.com/githubnext/ace2/issues/91:"},"https://github.com/githubnext/ace2/issues/91:"]

Expected

Trailing sentence punctuation (:, ., ,, ;, !, ?, and unbalanced closing brackets) after a bare URL stays outside the link, as in GitHub and other chat apps.

Observed while dogfooding #91 in Ace Canary 0.0.11. Part of #5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions