mirror of
https://github.com/outline/outline.git
synced 2026-05-08 02:50:30 -05:00
chore: Define classname in EditorStyleHelper (#9735)
This commit is contained in:
@@ -1333,7 +1333,7 @@ code {
|
||||
font-family: ${props.theme.fontFamilyMono};
|
||||
font-size: 90%;
|
||||
|
||||
.code-word {
|
||||
.${EditorStyleHelper.codeWord} {
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { EditorState, Plugin } from "prosemirror-state";
|
||||
import { Decoration, DecorationSet } from "prosemirror-view";
|
||||
import { EditorStyleHelper } from "../styles/EditorStyleHelper";
|
||||
|
||||
interface CodeWordDecorationsConfig {
|
||||
/** CSS class to apply to word decorations */
|
||||
@@ -9,7 +10,7 @@ interface CodeWordDecorationsConfig {
|
||||
class CodeWordDecorationsPlugin extends Plugin {
|
||||
constructor(config: CodeWordDecorationsConfig = {}) {
|
||||
const defaultConfig: Required<CodeWordDecorationsConfig> = {
|
||||
className: "code-word",
|
||||
className: EditorStyleHelper.codeWord,
|
||||
};
|
||||
|
||||
const finalConfig = { ...defaultConfig, ...config };
|
||||
@@ -50,7 +51,6 @@ class CodeWordDecorationsPlugin extends Plugin {
|
||||
}
|
||||
|
||||
state.doc.descendants((node, pos) => {
|
||||
// Only process text nodes
|
||||
if (node.isText && node.text) {
|
||||
// Check if this text node has the code_inline mark
|
||||
const codeMark = node.marks.find((mark) => mark.type === codeMarkType);
|
||||
|
||||
@@ -12,6 +12,10 @@ export class EditorStyleHelper {
|
||||
|
||||
static readonly comment = "comment-marker";
|
||||
|
||||
// Code
|
||||
|
||||
static readonly codeWord = "code-word";
|
||||
|
||||
// Tables
|
||||
|
||||
/** Table wrapper */
|
||||
|
||||
Reference in New Issue
Block a user