mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
Merge pull request #7748 from penpot/elenatorro-12586-fix-offset-y-on-new-lines
🐛 Fix new lines spacing between paragraphs
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -347,6 +347,23 @@ test("Renders a file with texts with with text spans of different sizes", async
|
||||
await expect(workspace.canvas).toHaveScreenshot();
|
||||
});
|
||||
|
||||
test("Renders a file with texts with paragraphs and breaking lines", async ({
|
||||
page,
|
||||
}) => {
|
||||
const workspace = new WasmWorkspacePage(page);
|
||||
await workspace.setupEmptyFile();
|
||||
await workspace.mockGetFile(
|
||||
"render-wasm/get-file-text-paragraph-new-lines.json",
|
||||
);
|
||||
|
||||
await workspace.goToWorkspace({
|
||||
id: "a5f238bd-dd8a-8164-8007-1bc3481eaf05",
|
||||
pageId: "a5f238bd-dd8a-8164-8007-1bc3481eaf06",
|
||||
});
|
||||
await workspace.waitForFirstRender();
|
||||
await expect(workspace.canvas).toHaveScreenshot();
|
||||
});
|
||||
|
||||
// TODO: enable this test once we use the wasm renderer in the new editor
|
||||
test.skip("Renders a file with texts with tabs", async ({ page }) => {
|
||||
const workspace = new WasmWorkspacePage(page);
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 136 KiB |
@@ -119,13 +119,6 @@
|
||||
[paragraph]
|
||||
(some #(not= "" (:text % "")) (:children paragraph)))
|
||||
|
||||
(defn should-filter-empty-paragraph?
|
||||
[paragraphs index]
|
||||
(and (not (has-content? (nth paragraphs index)))
|
||||
(< index (count paragraphs))
|
||||
(some has-content? (drop (inc index) paragraphs))
|
||||
(every? #(not (has-content? %)) (take (inc index) paragraphs))))
|
||||
|
||||
(defn create-inline
|
||||
[inline paragraph]
|
||||
(create-element
|
||||
@@ -150,7 +143,6 @@
|
||||
paragraphs (get-in root [:children 0 :children])
|
||||
filtered-paragraphs (->> paragraphs
|
||||
(map-indexed vector)
|
||||
(remove (fn [[index _]] (should-filter-empty-paragraph? paragraphs index)))
|
||||
(mapv second))]
|
||||
(create-element
|
||||
"div"
|
||||
|
||||
Reference in New Issue
Block a user