githubnext/ace2Public

Ace: a collaborative coding environment on the team's own machines

Exclude trailing punctuation from linkified URLs in the timeline

IA

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.

  1. iamnbutlerreferenced this in [Meta] Dogfood Ace end to end #5last month on GitHub

  2. iamnbutlerparent-issue-addedlast month on GitHub

  3. iamnbutlerreferenced this in feat(ui): attach images pasted into the composer #104last month on GitHub

  4. iamnbutlerreferenced this in Long chat messages clip their final rendered line #168last month on GitHub