Skip to content

Autolink literals swallow CJK punctuation and following text #326

@xxchan

Description

@xxchan

Bug Description

Autolink literals in CJK text treat fullwidth punctuation as part of the URL when there is no whitespace. Example: 请访问 https://example.com。谢谢 becomes a link to https://example.com。谢谢, so the punctuation and following CJK text are swallowed by the link.

Steps to Reproduce

import { Streamdown } from "streamdown";

export default function App() {
  const markdown = "请访问 https://example.com。谢谢";
  return <Streamdown>{markdown}</Streamdown>;
}

Expected Behavior

  • Link text/href: https://example.com
  • Trailing text 。谢谢 remains plain text

Actual Behavior

  • Link text/href includes the trailing CJK punctuation and text: https://example.com。谢谢

Environment

  • streamdown: 1.6.10
  • remark-gfm: 4.0.1 (default)

Additional Context

CJK emphasis is handled via remark-cjk-friendly, but autolink literal boundaries still follow GFM behavior. This feels related to trailing punctuation issues in autolinks (e.g. remarkjs/remark-gfm#12), but fullwidth CJK punctuation is not treated as a boundary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions