0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Removed Tailwind classes from comment contents

This commit is contained in:
Simon Backx 2022-07-08 10:38:36 +02:00
parent 19d2fba350
commit 8dfb77182e
3 changed files with 18 additions and 8 deletions

View file

@ -52,7 +52,7 @@ const Comment = (props) => {
</div>
</div>
<div className={`ml-14 mb-4 pr-4 font-sans leading-normal ${isNotPublished ? 'text-neutral-400' : 'text-neutral-900'} dark:text-[rgba(255,255,255,0.85)]`}>
<p dangerouslySetInnerHTML={html} className="whitespace-pre-wrap text-[16.5px] leading-normal"></p>
<p dangerouslySetInnerHTML={html} className="gh-comment-content text-[16.5px] leading-normal"></p>
</div>
<div className="ml-14 flex gap-5 items-center">
<Like comment={comment} />

View file

@ -15,7 +15,20 @@ body {
font-size: 1.5rem;
}
/* Comment HTML styles */
/* This makes sure we can have empty lines in comments (= <p></p>) */
.gh-comment-content p:empty::after {
content: "\00A0";
}
/* Links */
.gh-comment-content a {
text-decoration: underline;
}
/* The following lines are needed for the editor */
/* Placeholder */
.ProseMirror p.is-editor-empty:first-child::before {
content: attr(data-placeholder);

View file

@ -11,12 +11,7 @@ export function getEditorConfig({placeholder, autofocus = false, content = ''})
Text,
Paragraph,
Link.configure({
openOnClick: false,
// Add these HTML attributes to all the <a> links
// Warning: we need to do backend changes to make sure the sanitizer always picks the same class for links
HTMLAttributes: {
class: 'underline'
}
openOnClick: false
}),
Placeholder.configure({
placeholder
@ -26,8 +21,10 @@ export function getEditorConfig({placeholder, autofocus = false, content = ''})
autofocus,
editorProps: {
attributes: {
class: `focus:outline-0`
class: `gh-comment-content focus:outline-0`
}
}
};
}
/** We need to post process the HTML from tiptap, because tiptap by default */