mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(catalog): preserve literal preview markers
This commit is contained in:
@@ -480,6 +480,22 @@ describe('CatalogRow', () => {
|
||||
expect(container.textContent).toContain('Text title: Plain thread body');
|
||||
});
|
||||
|
||||
it('preserves literal catalog teaser markers without applying body markdown styles', async () => {
|
||||
const post: TestComment = {
|
||||
cid: 'literal-markers',
|
||||
content: '>we got 5chan before Half Life 3\n*poisons u*',
|
||||
replyCount: 2,
|
||||
communityAddress: 'music-posting.eth',
|
||||
};
|
||||
|
||||
await renderWithRouter(createElement(CatalogRow, { row: [post] }), '/mu/catalog');
|
||||
|
||||
expect(container.textContent).toContain('>we got 5chan before Half Life 3');
|
||||
expect(container.textContent).toContain('*poisons u*');
|
||||
expect(container.querySelector('.greentext')).toBeNull();
|
||||
expect(container.querySelector('.spoilertext')).toBeNull();
|
||||
});
|
||||
|
||||
it('applies the estimated row height to the virtualization wrapper', async () => {
|
||||
const post: TestComment = {
|
||||
cid: 'estimated-post',
|
||||
|
||||
@@ -18,7 +18,7 @@ import useCountLinksInReplies from '../../hooks/use-count-links-in-replies';
|
||||
import useFetchGifFirstFrame from '../../hooks/use-fetch-gif-first-frame';
|
||||
import useHide from '../../hooks/use-hide';
|
||||
import { isCommentArchived } from '../../lib/utils/comment-moderation-utils';
|
||||
import { removeMarkdown } from '../../lib/utils/post-utils';
|
||||
import { CATALOG_PREVIEW_MARKDOWN_OPTIONS, removeMarkdown } from '../../lib/utils/post-utils';
|
||||
import PostMenuDesktop from '../post-desktop/post-menu-desktop';
|
||||
import styles from './catalog-row.module.css';
|
||||
import capitalize from 'lodash/capitalize';
|
||||
@@ -215,7 +215,7 @@ const CatalogPost = memo(
|
||||
{content ? ': ' : ''}
|
||||
</span>
|
||||
)}
|
||||
{content && removeMarkdown(content)}
|
||||
{content && removeMarkdown(content, CATALOG_PREVIEW_MARKDOWN_OPTIONS)}
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user