fix: add new styling for emoji links (#14481)

This commit is contained in:
Carina Wollendorfer authored and GitHub committed 2024-04-17 12:30:14 +00:00
1 parent 4aeb6b7c9b
commit 8bb5200dd8
6 files changed
+57 -25

No files matched your search

@@ -4,6 +4,7 @@ const exampleTheme = {
heading: {
h1: "editor-heading-h1",
h2: "editor-heading-h2",
h6: "editor-heading-h6",
},
list: {
nested: {
@@ -376,7 +376,12 @@ export default function ToolbarPlugin(props: TextEditorProps) {
editor.registerUpdateListener(({ editorState, prevEditorState }) => {
editorState.read(() => {
const textInHtml = $generateHtmlFromNodes(editor).replace(/&lt;/g, "<").replace(/&gt;/g, ">");
props.setText(textInHtml);
props.setText(
textInHtml.replace(
/<p\s+class="editor-paragraph"[^>]*>\s*<br>\s*<\/p>/g,
"<p class='editor-paragraph'></p>"
)
);
});
if (!prevEditorState._selection) editor.blur();
});
+11 -5
View File
@@ -1,7 +1,3 @@
.editor a {
text-decoration: underline;
font-size: 14px;
}
.editor li {
padding-left: 1.28571429em;
@@ -56,9 +52,18 @@
font-style: italic;
}
// h6 is only used for emoji links
.editor-heading-h6 {
}
h6 a {
font-size: 20px !important;
text-decoration: none !important;
}
.editor-link {
color: rgb(33, 111, 219);
text-decoration: none;
text-decoration: underline;
}
.editor-tokenFunction {
@@ -67,6 +72,7 @@
.editor-paragraph {
margin: 0;
margin-top:14px;
position: relative;
color: var(--cal-text);
}