Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): thread links written as [label](<t3-thread://…>) no longer turn into broken text #28476

ClosedEtanHey(GitHub profile, opens in a new tab)wants to merge 6 commits intomain fromrefs/pull/28476/headopened View on GitHub

Showing 2 changed files with 7 additions and 5 deletions.

x
0 of 2 viewed, 2 left
6 additions and 4 deletionspackages/shared/src/threadLinks.test.tsModified
View file
@@ -97,11 +97,13 @@
const title = titlesIn({ local: { t1: "Here" }, there: { t1: "There" } });
expect(
relabelThreadLinks(
- "<t3-thread://v2/there/t1> and [old](t3-thread://v2/local/t1)",
+ "<t3-thread://v2/there/t1> and [old](t3-thread://v2/local/t1) and [old](<t3-thread://v2/local/t1>)",
local,
title,
- ).toBe("[There](t3-thread://v2/there/t1) and [Here](t3-thread://v2/local/t1)");
+ ).toBe(
+ "[There](t3-thread://v2/there/t1) and [Here](t3-thread://v2/local/t1) and [Here](t3-thread://v2/local/t1)",
+ );
});
​
it("reads an angle-bracketed destination as the labeled link, not an autolink", () => {
@@ -122,11 +124,11 @@
it("turns a v2 link it cannot resolve into plain text, never the raw link", () => {
expect(
relabelThreadLinks(
- "<t3-thread://v2/there/t1>, <t3-thread://v2/local/t1>, [Old title](t3-thread://v2/there/t1)",
+ "<t3-thread://v2/there/t1>, <t3-thread://v2/local/t1>, [Old title](t3-thread://v2/there/t1), [Kept](<t3-thread://v2/local/t1>)",
local,
() => undefined,
- ).toBe("Thread on another machine, Thread no longer available, Old title");
+ ).toBe("Thread on another machine, Thread no longer available, Old title, Kept");
expect(relabelThreadLinks("[Old](t3-thread://v1/t1)", local, () => undefined)).toBe(
"[Old](t3-thread://v1/t1)",