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
5 changes: 5 additions & 0 deletions .changeset/tiny-pianos-enter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lynx-js/web-elements": patch
---

fix: line-height of markdown-style should be added `px`
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ const preprocessInlineView = (html: string) =>

const unitlessCssProperties = new Set([
'font-weight',
'line-height',
'opacity',
'z-index',
'flex',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
},
link: {
color: 'ff0000',
lineHeight: 24,
},
inlineCode: {
color: '0000ff',
Expand Down
5 changes: 5 additions & 0 deletions packages/web-platform/web-elements/tests/x-markdown.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
await goto(page, 'x-markdown/basic');
const markdown = page.locator('x-markdown');

await expect(markdown.locator('h1')).toHaveText('Title');

Check failure on line 97 in packages/web-platform/web-elements/tests/x-markdown.spec.ts

View workflow job for this annotation

GitHub Actions / Playwright Web Elements Test (2/2) / check

[chromium] › tests/x-markdown.spec.ts:93:3 › x-markdown › should render basic markdown

2) [chromium] › tests/x-markdown.spec.ts:93:3 › x-markdown › should render basic markdown ──────── Error: expect(locator).toHaveText(expected) failed Locator: locator('x-markdown').locator('h1') Expected: "Title" Timeout: 5000ms Error: element(s) not found Call log: - Expect "toHaveText" with timeout 5000ms - waiting for locator('x-markdown').locator('h1') 95 | const markdown = page.locator('x-markdown'); 96 | > 97 | await expect(markdown.locator('h1')).toHaveText('Title'); | ^ 98 | await expect(markdown.locator('strong')).toHaveText('bold'); 99 | await expect(markdown.locator('em')).toHaveText('italic'); 100 | await expect(markdown.locator('li')).toHaveCount(2); at /__w/lynx-stack/lynx-stack/packages/web-platform/web-elements/tests/x-markdown.spec.ts:97:42
await expect(markdown.locator('strong')).toHaveText('bold');
await expect(markdown.locator('em')).toHaveText('italic');
await expect(markdown.locator('li')).toHaveCount(2);
Expand All @@ -104,9 +104,14 @@
test('should apply markdown-style updates', async ({ page }) => {
await goto(page, 'x-markdown/style');
const markdown = page.locator('x-markdown');
await page.waitForFunction(() => {
const element = document.querySelector('x-markdown');
return element?.shadowRoot?.querySelector('a')?.textContent === 'link';
});

const link = markdown.locator('a');
await expect(link).toHaveCSS('color', 'rgb(255, 0, 0)');
await expect(link).toHaveCSS('line-height', '24px');

const inlineCode = markdown.locator('code').first();
await expect(inlineCode).toHaveCSS('color', 'rgb(0, 0, 255)');
Expand Down
Loading