v4: a description shows as text where a list quotes it — a playlist's card printed its description as written, so one holding an image showed "", and so did a user's line in the search results. Both now go through markdownToPlainText (shared/markdown.ts), as the chat's reply previews do: the markup goes, a link keeps its text, an image is left out, and a description of nothing but an image leaves no line. The playlist's page and the profile render the Markdown as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -38,6 +38,34 @@ describe("PlaylistCard", () => {
|
||||
expect(currentPath()).toBe("/@ann/playlists/mix");
|
||||
});
|
||||
|
||||
test("the description shows as text, without its Markdown or its images", () => {
|
||||
const withText = renderWithContexts(
|
||||
<ul>
|
||||
<PlaylistCard
|
||||
playlist={makePlaylist({
|
||||
description:
|
||||
"**Late** [tunes](https://x.y) ",
|
||||
})}
|
||||
/>
|
||||
</ul>,
|
||||
);
|
||||
expect(
|
||||
withText.container.querySelector(".playlist-card-description"),
|
||||
).toHaveTextContent(/^Late tunes$/);
|
||||
withText.unmount();
|
||||
|
||||
const imageOnly = renderWithContexts(
|
||||
<ul>
|
||||
<PlaylistCard
|
||||
playlist={makePlaylist({ description: "" })}
|
||||
/>
|
||||
</ul>,
|
||||
);
|
||||
expect(
|
||||
imageOnly.container.querySelector(".playlist-card-description"),
|
||||
).toBeNull();
|
||||
});
|
||||
|
||||
test("the owner doesn't see their own name, or an unread dot", () => {
|
||||
const p = makePlaylist({ ownerUsername: "me", createdAt: new Date() });
|
||||
const { container } = renderWithContexts(
|
||||
|
||||
Reference in New Issue
Block a user