Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions __tests__/components/drops/view/part/DropPartMarkdown.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ describe("DropPartMarkdown", () => {
expect(a).toHaveAttribute("href", "https://google.com");
});

it("renders separate spaced paragraphs for blank-line content", () => {
it("renders separate paragraphs for blank-line content with tight spacing", () => {
render(
<DropPartMarkdown
mentionedUsers={[]}
Expand All @@ -642,8 +642,26 @@ describe("DropPartMarkdown", () => {
expect(paragraphs).toHaveLength(2);
expect(paragraphs[0]).toHaveTextContent("First");
expect(paragraphs[1]).toHaveTextContent("Second");
expect(paragraphs[0]?.className).toContain("tw-mb-3");
expect(paragraphs[0]?.className).toContain("last:tw-mb-0");
expect(paragraphs[0]?.className).toContain("tw-mb-0");
expect(paragraphs[0]?.className).not.toContain("tw-mb-3");
});

it("preserves one visible blank line when content has triple newlines", () => {
render(
<DropPartMarkdown
mentionedUsers={[]}
mentionedWaves={[]}
referencedNfts={[]}
partContent={"First\n\n\nSecond"}
onQuoteClick={jest.fn()}
/>
);

const paragraphs = document.querySelectorAll("p.word-break");
expect(paragraphs).toHaveLength(3);
expect(paragraphs[0]).toHaveTextContent("First");
expect(paragraphs[1]?.textContent).toBe("\u00a0");
expect(paragraphs[2]).toHaveTextContent("Second");
});

it("renders one inline show-previews action when previews are hidden", async () => {
Expand Down
2 changes: 1 addition & 1 deletion components/drops/view/part/dropPartMarkdown/content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export const createMarkdownContentRenderers = ({
) => (
<p
key={getRandomObjectId()}
className={`word-break tw-mb-3 tw-whitespace-pre-wrap tw-break-words tw-font-normal tw-leading-6 tw-text-iron-200 tw-transition tw-duration-300 tw-ease-out last:tw-mb-0 ${textSizeClass}`}
className={`word-break tw-mb-0 tw-whitespace-pre-wrap tw-break-words tw-font-normal tw-leading-6 tw-text-iron-200 tw-transition tw-duration-300 tw-ease-out ${textSizeClass}`}
>
{customRenderer(paragraphParams.children)}
</p>
Expand Down