mirror of
https://github.com/go-gitea/gitea.git
synced 2026-11-11 22:03:13 +00:00
Backport #40053 by @silverwind Copying lines from a diff, file view, blame, code search or code preview and pasting them into a comment on Gitea or GitHub produced a markdown table with escaped pipes and stripped indentation. Both use `@github/paste-markdown`, which converts copied HTML tables unless they carry `data-paste-markdown-skip`, as GitHub's own code tables do. Gitea's code tables now set it too. The test is a bit more complicated because of a upstream bug which causes `paste-markdown` to insert pasted content twice, once https://github.com/github/paste-markdown/pull/128 is merged and released, the negative assertion could be removed. Signed-off-by: silverwind <me@silverwind.io> Co-authored-by: silverwind <me@silverwind.io>
import {env} from 'node:process';
import {test, expect} from '@playwright/test';
import {apiCreateRepo, randomString} from './utils.ts';
test('repo readme', async ({page}) => {
const repoName = `e2e-readme-${randomString(8)}`;
await apiCreateRepo(page.request, {name: repoName});
await page.goto(`/${env.GITEA_TEST_E2E_USER}/${repoName}`);
await expect(page.locator('#readme')).toContainText(repoName);
});