diff --git a/packages/pdf/src/templates/azurill/AzurillPage.tsx b/packages/pdf/src/templates/azurill/AzurillPage.tsx index 1c76602ef..ed80b89e5 100644 --- a/packages/pdf/src/templates/azurill/AzurillPage.tsx +++ b/packages/pdf/src/templates/azurill/AzurillPage.tsx @@ -210,7 +210,6 @@ const useAzurillTemplate = (): AzurillTemplate => { richListItemContent: { ...bodyText, flex: 1, - lineHeight: metadata.typography.body.lineHeight * 0.5, }, splitRow: { flexDirection: r.row, diff --git a/packages/pdf/src/templates/bronzor/BronzorPage.tsx b/packages/pdf/src/templates/bronzor/BronzorPage.tsx index bf6501278..e4e0347bd 100644 --- a/packages/pdf/src/templates/bronzor/BronzorPage.tsx +++ b/packages/pdf/src/templates/bronzor/BronzorPage.tsx @@ -206,7 +206,6 @@ const useBronzorTemplate = (): BronzorTemplate => { richListItemContent: { ...bodyText, flex: 1, - lineHeight: metadata.typography.body.lineHeight * 0.5, }, splitRow: { flexDirection: r.row, diff --git a/packages/pdf/src/templates/chikorita/ChikoritaPage.tsx b/packages/pdf/src/templates/chikorita/ChikoritaPage.tsx index 77bf791c1..da6baf691 100644 --- a/packages/pdf/src/templates/chikorita/ChikoritaPage.tsx +++ b/packages/pdf/src/templates/chikorita/ChikoritaPage.tsx @@ -220,7 +220,6 @@ const useChikoritaTemplate = (): ChikoritaTemplate => { richListItemContent: { ...bodyText, flex: 1, - lineHeight: metadata.typography.body.lineHeight * 0.5, }, splitRow: { flexDirection: r.row, diff --git a/packages/pdf/src/templates/ditgar/DitgarPage.tsx b/packages/pdf/src/templates/ditgar/DitgarPage.tsx index 2f3a62344..9d5caee93 100644 --- a/packages/pdf/src/templates/ditgar/DitgarPage.tsx +++ b/packages/pdf/src/templates/ditgar/DitgarPage.tsx @@ -248,7 +248,6 @@ const useDitgarTemplate = (): DitgarTemplate => { richListItemContent: { ...bodyText, flex: 1, - lineHeight: metadata.typography.body.lineHeight * 0.5, }, splitRow: { flexDirection: r.row, diff --git a/packages/pdf/src/templates/ditto/DittoPage.tsx b/packages/pdf/src/templates/ditto/DittoPage.tsx index fff1fe046..393d109f6 100644 --- a/packages/pdf/src/templates/ditto/DittoPage.tsx +++ b/packages/pdf/src/templates/ditto/DittoPage.tsx @@ -216,7 +216,6 @@ const useDittoTemplate = (): DittoTemplate => { richListItemContent: { ...bodyText, flex: 1, - lineHeight: metadata.typography.body.lineHeight * 0.5, }, splitRow: { flexDirection: r.row, diff --git a/packages/pdf/src/templates/gengar/GengarPage.tsx b/packages/pdf/src/templates/gengar/GengarPage.tsx index 15a2275cc..a8e8d00f0 100644 --- a/packages/pdf/src/templates/gengar/GengarPage.tsx +++ b/packages/pdf/src/templates/gengar/GengarPage.tsx @@ -245,7 +245,6 @@ const useGengarTemplate = (): GengarTemplate => { richListItemContent: { ...bodyText, flex: 1, - lineHeight: metadata.typography.body.lineHeight * 0.5, }, splitRow: { flexDirection: r.row, diff --git a/packages/pdf/src/templates/glalie/GlaliePage.tsx b/packages/pdf/src/templates/glalie/GlaliePage.tsx index 395f75991..073248881 100644 --- a/packages/pdf/src/templates/glalie/GlaliePage.tsx +++ b/packages/pdf/src/templates/glalie/GlaliePage.tsx @@ -225,7 +225,6 @@ const useGlalieTemplate = (): GlalieTemplate => { richListItemContent: { ...bodyText, flex: 1, - lineHeight: metadata.typography.body.lineHeight * 0.5, }, splitRow: { flexDirection: r.row, diff --git a/packages/pdf/src/templates/index.test.ts b/packages/pdf/src/templates/index.test.ts index 1f89f0e5f..f492cd4b7 100644 --- a/packages/pdf/src/templates/index.test.ts +++ b/packages/pdf/src/templates/index.test.ts @@ -1,4 +1,4 @@ -import { readFileSync } from "node:fs"; +import { existsSync, readdirSync, readFileSync } from "node:fs"; import { fileURLToPath } from "node:url"; import { describe, expect, it } from "vitest"; @@ -9,4 +9,22 @@ describe("templatePages", () => { expect(registry).toContain('import { ScizorPage } from "./scizor/ScizorPage";'); expect(registry).toContain("scizor: ScizorPage"); }); + + it("keeps rich-text list content at the body line height", () => { + const templatesDir = fileURLToPath(new URL(".", import.meta.url)); + const pageFiles = readdirSync(templatesDir, { withFileTypes: true }) + .filter((entry) => entry.isDirectory()) + .map( + (entry) => + new URL(`./${entry.name}/${entry.name[0]?.toUpperCase()}${entry.name.slice(1)}Page.tsx`, import.meta.url), + ) + .map((url) => fileURLToPath(url)) + .filter((path) => existsSync(path)); + + for (const pageFile of pageFiles) { + const template = readFileSync(pageFile, "utf8"); + + expect(template).not.toContain("lineHeight: metadata.typography.body.lineHeight * 0.5"); + } + }); }); diff --git a/packages/pdf/src/templates/kakuna/KakunaPage.tsx b/packages/pdf/src/templates/kakuna/KakunaPage.tsx index 625b15022..160621453 100644 --- a/packages/pdf/src/templates/kakuna/KakunaPage.tsx +++ b/packages/pdf/src/templates/kakuna/KakunaPage.tsx @@ -188,7 +188,6 @@ const useKakunaTemplate = (): KakunaTemplate => { richListItemContent: { ...bodyText, flex: 1, - lineHeight: metadata.typography.body.lineHeight * 0.5, }, splitRow: { flexDirection: r.row, diff --git a/packages/pdf/src/templates/lapras/LaprasPage.tsx b/packages/pdf/src/templates/lapras/LaprasPage.tsx index 40adf901b..be5dd2871 100644 --- a/packages/pdf/src/templates/lapras/LaprasPage.tsx +++ b/packages/pdf/src/templates/lapras/LaprasPage.tsx @@ -190,7 +190,6 @@ const useLaprasTemplate = (): LaprasTemplate => { richListItemContent: { ...bodyText, flex: 1, - lineHeight: metadata.typography.body.lineHeight * 0.5, }, splitRow: { flexDirection: r.row, diff --git a/packages/pdf/src/templates/leafish/LeafishPage.tsx b/packages/pdf/src/templates/leafish/LeafishPage.tsx index 686ffef2a..26060c7f6 100644 --- a/packages/pdf/src/templates/leafish/LeafishPage.tsx +++ b/packages/pdf/src/templates/leafish/LeafishPage.tsx @@ -216,7 +216,6 @@ const useLeafishTemplate = (): LeafishTemplate => { richListItemContent: { ...bodyText, flex: 1, - lineHeight: metadata.typography.body.lineHeight * 0.5, }, splitRow: { flexDirection: r.row, diff --git a/packages/pdf/src/templates/meowth/MeowthPage.tsx b/packages/pdf/src/templates/meowth/MeowthPage.tsx index 185756aed..35e1d3513 100644 --- a/packages/pdf/src/templates/meowth/MeowthPage.tsx +++ b/packages/pdf/src/templates/meowth/MeowthPage.tsx @@ -191,7 +191,6 @@ const useMeowthTemplate = (): MeowthTemplate => { richListItemContent: { ...bodyText, flex: 1, - lineHeight: metadata.typography.body.lineHeight * 0.5, }, splitRow: { flexDirection: r.row, diff --git a/packages/pdf/src/templates/onyx/OnyxPage.tsx b/packages/pdf/src/templates/onyx/OnyxPage.tsx index ca953a4c4..ad2275949 100644 --- a/packages/pdf/src/templates/onyx/OnyxPage.tsx +++ b/packages/pdf/src/templates/onyx/OnyxPage.tsx @@ -186,7 +186,6 @@ const useOnyxTemplate = (): OnyxTemplate => { richListItemContent: { ...bodyText, flex: 1, - lineHeight: metadata.typography.body.lineHeight * 0.5, }, splitRow: { flexDirection: r.row, diff --git a/packages/pdf/src/templates/pikachu/PikachuPage.tsx b/packages/pdf/src/templates/pikachu/PikachuPage.tsx index bb40de482..cf1f8d3b7 100644 --- a/packages/pdf/src/templates/pikachu/PikachuPage.tsx +++ b/packages/pdf/src/templates/pikachu/PikachuPage.tsx @@ -223,7 +223,6 @@ const usePikachuTemplate = (): PikachuTemplate => { richListItemContent: { ...bodyText, flex: 1, - lineHeight: metadata.typography.body.lineHeight * 0.5, }, splitRow: { flexDirection: r.row, diff --git a/packages/pdf/src/templates/rhyhorn/RhyhornPage.tsx b/packages/pdf/src/templates/rhyhorn/RhyhornPage.tsx index bf68bdee9..96f105bfb 100644 --- a/packages/pdf/src/templates/rhyhorn/RhyhornPage.tsx +++ b/packages/pdf/src/templates/rhyhorn/RhyhornPage.tsx @@ -236,7 +236,6 @@ const useRhyhornTemplate = (): RhyhornTemplate => { richListItemContent: { ...bodyText, flex: 1, - lineHeight: metadata.typography.body.lineHeight * 0.5, }, splitRow: { flexDirection: r.row, diff --git a/packages/pdf/src/templates/scizor/ScizorPage.tsx b/packages/pdf/src/templates/scizor/ScizorPage.tsx index 2d1a06a7e..21b164750 100644 --- a/packages/pdf/src/templates/scizor/ScizorPage.tsx +++ b/packages/pdf/src/templates/scizor/ScizorPage.tsx @@ -183,7 +183,6 @@ const useScizorTemplate = (): ScizorTemplate => { richListItemContent: { ...bodyText, flex: 1, - lineHeight: metadata.typography.body.lineHeight * 0.5, }, splitRow: { flexDirection: r.row,