Underline markdown links that have emojis

This commit is contained in:
Sebastian Martinez
2024-04-04 13:37:37 +02:00
parent 127efc49a5
commit 187a67e03e
3 changed files with 10 additions and 1 deletions
+5 -1
View File
@@ -111,7 +111,11 @@
console.warn("Not able to parse url", e);
}
// Don't underline <a> tags that contain images.
if (e.firstElementChild instanceof HTMLImageElement) {
// Make an exception for emojis.
if (
e.firstElementChild instanceof HTMLImageElement &&
!e.firstElementChild.classList.contains("txt-emoji")
) {
e.classList.add("no-underline");
}
}
Binary file not shown.
+5
View File
@@ -160,6 +160,11 @@ test("relative image not able to being loaded", async ({ page }) => {
await expect(page).toHaveScreenshot({ fullPage: true });
});
test("underline links that contain emojis", async ({ page }) => {
await page.goto(`${markdownUrl}/tree/main/link-files.md`);
await expect(page).toHaveScreenshot({ fullPage: true });
});
test("markdown in issues is not overflowing", async ({ page }) => {
await page.goto(`${markdownUrl}/issues`, {
waitUntil: "networkidle",