Repository navigation
fix(cli): stop bare-URL hyperlinks at full-width CJK punctuation #8755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
f4d0d0c
8b01f10
ae76eef
01a37f3
0aa4fdc
c871945
3202a63
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ import stringWidth from 'string-width'; | |
| import { createDebugLogger } from '@qwen-code/qwen-code-core'; | ||
| import { renderInlineLatex } from './latexRenderer.js'; | ||
| import { | ||
| BARE_URL_PATTERN, | ||
| MD_LINK_CAPTURE, | ||
| MD_LINK_PATTERN, | ||
| isSafeOscScheme, | ||
|
|
@@ -38,7 +39,7 @@ const UNDERLINE_TAG_START_LENGTH = 3; // For "<u>" | |
| const UNDERLINE_TAG_END_LENGTH = 4; // For "</u>" | ||
| const INLINE_MARKDOWN_REGEX = new RegExp( | ||
| String.raw`(\*\*.*?\*\*|\*.*?\*|_.*?_|~~.*?~~|${MD_LINK_PATTERN}|` + | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P0 Critical] Re-tokenization: after Pre-PR One possible direction: add a negative lookbehind so |
||
| String.raw`${INLINE_CODE_SPAN_PATTERN_SOURCE}|<u>.*?<\/u>|https?:\/\/\S+)`, | ||
| String.raw`${INLINE_CODE_SPAN_PATTERN_SOURCE}|<u>.*?<\/u>|${BARE_URL_PATTERN})`, | ||
|
yiliang114 marked this conversation as resolved.
Resolved
yiliang114 marked this conversation as resolved.
Resolved
|
||
| 'g', | ||
| ); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,6 +19,7 @@ import { | |
| unescapeMarkdownDollars, | ||
| } from './inline-math.js'; | ||
| import { | ||
| BARE_URL_PATTERN, | ||
| MD_LINK_CAPTURE, | ||
| MD_LINK_PATTERN, | ||
| isSafeOscScheme, | ||
|
|
@@ -50,7 +51,7 @@ const SAFETY_MARGIN = 4; | |
|
|
||
| const INLINE_MARKDOWN_REGEX = new RegExp( | ||
| String.raw`(\*\*.*?\*\*|\*.*?\*|_.*?_|~~.*?~~|${MD_LINK_PATTERN}|` + | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same re-tokenization issue as InlineMarkdownRenderer.tsx:41 — this is the identical |
||
| String.raw`${INLINE_CODE_SPAN_PATTERN_SOURCE}|<u>.*?<\/u>|https?:\/\/\S+)`, | ||
| String.raw`${INLINE_CODE_SPAN_PATTERN_SOURCE}|<u>.*?<\/u>|${BARE_URL_PATTERN})`, | ||
| 'g', | ||
| ); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.