Skip to content

Commit

Permalink
fix: newlines do not work in block quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
prathameshkurunkar7 committed Apr 11, 2024
1 parent 6e16e94 commit 5478ff9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 46 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import json from 'highlight.js/lib/languages/json'
import CodeBlockLowlight from '@tiptap/extension-code-block-lowlight'
import { common, createLowlight } from 'lowlight'
import python from 'highlight.js/lib/languages/python'
import { CustomBlockquote } from './Blockquote'
import { CustomBold } from './Bold'
import { CustomUserMention } from './Mention'
import { CustomLink } from './Link'
Expand Down Expand Up @@ -52,7 +51,6 @@ export const TiptapRenderer = ({ message, user, isScrolling = false, isTruncated
heading: false,
codeBlock: false,
bold: false,
blockquote: false,
italic: false,
listItem: {
HTMLAttributes: {
Expand All @@ -63,7 +61,12 @@ export const TiptapRenderer = ({ message, user, isScrolling = false, isTruncated
HTMLAttributes: {
class: 'rt-Text text-base'
}
}
},
blockquote: {
HTMLAttributes: {
class: 'pl-4 border-l-4 border-gray-500'
}
},
}),
Highlight.configure({
multicolor: true,
Expand All @@ -75,7 +78,6 @@ export const TiptapRenderer = ({ message, user, isScrolling = false, isTruncated
CodeBlockLowlight.configure({
lowlight
}),
CustomBlockquote,
CustomBold,
CustomUserMention,
CustomLink,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ import json from 'highlight.js/lib/languages/json'
import CodeBlockLowlight from '@tiptap/extension-code-block-lowlight'
import { common, createLowlight } from 'lowlight'
import python from 'highlight.js/lib/languages/python'
import { CustomBlockquote } from './Blockquote'
import { CustomBold } from './Bold'
import { CustomUserMention } from './Mention'
import { CustomLink, LinkPreview } from './Link'
import { CustomUnderline } from './Underline'
import { Image } from '@tiptap/extension-image'
import { clsx } from 'clsx'
import Italic from '@tiptap/extension-italic';
import './tiptap-renderer.styles.css'
const lowlight = createLowlight(common)

lowlight.register('html', html)
Expand All @@ -44,7 +44,7 @@ export const TiptapRenderer = ({ message, user, isScrolling = false, isTruncated
editable: false,
editorProps: {
attributes: {
class: isTruncated ? 'line-clamp-3' : ''
class: isTruncated ? 'tiptap-renderer line-clamp-3' : 'tiptap-renderer'
}
},
enableCoreExtensions: true,
Expand All @@ -53,7 +53,6 @@ export const TiptapRenderer = ({ message, user, isScrolling = false, isTruncated
heading: false,
codeBlock: false,
bold: false,
blockquote: false,
italic: false,
listItem: {
HTMLAttributes: {
Expand All @@ -76,7 +75,6 @@ export const TiptapRenderer = ({ message, user, isScrolling = false, isTruncated
CodeBlockLowlight.configure({
lowlight
}),
CustomBlockquote,
CustomBold,
CustomUserMention,
CustomLink,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.tiptap-renderer blockquote {
border-left: 3px solid var(--gray-11);
padding-left: 0.8rem;
margin: 1rem;
}

0 comments on commit 5478ff9

Please sign in to comment.