Repository navigation
Conversation
A parenthesised path with a space in its filename was linked as the folder prefix. .conf joins the shared link extensions, parentheses bound the whole path, and a hard wrap between filename words keeps the separating space and the clickable cells on each row. Fixes Ark0N#733 Co-authored-by: DDT <1786035110@qq.com>
|
Thank you for picking this up, Hugo-DDT. This PR makes a parenthesised path with a space in its name, such as The 1. Parentheses act as a path label, so prose inside them becomes a path (
Both surfaces share 2.
So "Existing URL, folder, and mid-token path joins are unchanged" does not hold for a cut between two letters after an open paren. Please scope the rule to the parenthesis that opens the broken-off path itself (not Even scoped that way, the third shape stays ambiguous: a parenthesised path cut between two letters looks exactly like the Kobo wrap, and both readings are valid paths. Whether fixing the wrapped Kobo case is worth that cost is an open question on my side. If the rule stays, the trade-off needs a sentence in Smaller
Typecheck, lint, format and the link test files all pass locally and CI is green; the problems above are behaviours the current tests do not exercise. Once items 1 and 2 are addressed and the trade-off question is settled, this is close to ready. |
Parentheses accept only an absolute spaced path. Join-space applies to the parenthesis that opens that path, never an earlier one or a :// token. Co-authored-by: DDT <1786035110@qq.com>
|
Thank you for the quick second round, Hugo-DDT. This PR links a parenthesised absolute path with a space in its name, such as The second commit covers everything from my earlier review: the synthesized-label and bare-filename fallbacks are gone and the six prose rows are pinned as negative tests, 1. The space is kept whenever the path's
This is a different cost from the documented trade-off: there one link goes to the spaced name, here a link that works on master becomes two wrong ones, and the real Kobo wrap gains nothing in these shapes either ( if (!/^[^()]*\)[\].,;:!?]*$/.test(headText)) return false;I ran that on a copy: the three rows above go back to master's join, while the Kobo wrap, the Smaller
Open question Whether |
Join-space now requires the continuation token to close the parenthesis right after the extension. A parenthesis that does not open the broken-off token still joins with no space. Co-authored-by: DDT <1786035110@qq.com>
|
Thank you for the third round, Hugo-DDT. This PR links a parenthesised absolute path with a space in its name, such as The third commit covers every point from my last review: 1.
The Kobo reading of these shapes gains nothing either ( if (!/[A-Za-z0-9]$/.test(tail)) return false;
// Only where parenthesisedSpacedPaths will take the spaced name whole.
const candidate = `${tail.replace(/^\(/, '')} ${bare}`;
return spacedFilePathOnLine(candidate)?.path === candidate;I ran that on a copy: the four rows above go back to master's join, and the Kobo wrap (both rows, cells included), the
Smaller
Open question Whether |
Join-space now requires the spaced name to be an absolute path spacedFilePathOnLine takes whole, so a relative, ~/ or scripts/ wrap joins without a space. Co-authored-by: DDT <1786035110@qq.com>
|
Thank you for the fourth round, Hugo-DDT. This PR links a parenthesised absolute path with a space in its name, such as The fourth commit covers every point from my last review: 1. A The inside of every parenthesis pair is judged as an own-line path, and Claude Code prints each shell command as
This is the same class as the earlier rounds (a link that works on master becomes a link to a file that does not exist), reached through the absolute-path branch. One guard that names no tool, which I ran on a copy of // A call-shaped `Name(` wraps a command as often as a path: there, take the
// spaced path only when the space sits in a directory.
const called = open > 0 && /\w/.test(text[open - 1]);
if (hit && called && !hit.path.split(' ').slice(1).some((word) => word.includes('/'))) continue;It gives the three rows back their master links and keeps Open question Whether Nothing else is outstanding: once the |
A Name( wrapper takes a spaced path only when the space sits in a directory. Bash(/tmp/a.out input.txt) links input.txt again, while Update(/home/me/proj/My Docs/notes.md) stays one path.
|
Thank you for the fifth round, Hugo-DDT. This PR links a parenthesised absolute path with a space in its name, such as The fifth commit covers the Still open on my side Whether
None of the code needs to change for this round. The one-line parenthesised detection and the |
Fixes #733
A parenthesised absolute file path whose name contains a space (
(/mnt/data/Kobo/Kobo eReader.conf), including one hard-wrapped between the words) is linked as that whole file. A relative path or a bare spaced filename inside parentheses is left to the ordinary detectors, which still need an explicit path label for a spaced relative path..confis a link extension, the same text the attachment routes already serve. The space a hard wrap consumed stays in the path when the parenthesis starts the broken-off token (or is separated from it by whitespace only), the next token closes it right after the extension, and the spaced name is an absolute path the parenthesised detector takes whole. The clickable cells stay on the rows that hold the name.Tests:
test/spaced-file-path-links.test.ts,test/file-path-link-forms.test.ts, andtest/response-viewer-file-links.test.ts.