mirror of
https://github.com/outline/outline.git
synced 2026-12-03 10:00:13 +03:00
fix: Long code words can overflow comment bounds (#12961)
* fix: Long code words can overflow comment bounds * Add to RevisionViewer
This commit is contained in:
1 parent
3539278653
commit
96a5034714
7 files changed
+22
-5
No files matched your search
@@ -19,8 +19,9 @@ import useCurrentUser from "~/hooks/useCurrentUser";
|
||||
import usePolicy from "~/hooks/usePolicy";
|
||||
import useStores from "~/hooks/useStores";
|
||||
import type { Properties } from "~/types";
|
||||
import CodeWordBreak from "@shared/editor/extensions/CodeWordBreak";
|
||||
|
||||
const extensions = withUIExtensions(richExtensions);
|
||||
const extensions = [CodeWordBreak, ...withUIExtensions(richExtensions)];
|
||||
|
||||
type Props = {
|
||||
collection: Collection;
|
||||
|
||||
@@ -37,8 +37,12 @@ import DocumentTitle from "./DocumentTitle";
|
||||
import { first } from "es-toolkit/compat";
|
||||
import { getLangFor } from "~/utils/language";
|
||||
import useShare from "@shared/hooks/useShare";
|
||||
import CodeWordBreak from "@shared/editor/extensions/CodeWordBreak";
|
||||
|
||||
const extensions = withUIExtensions(withComments(richExtensions));
|
||||
const extensions = [
|
||||
CodeWordBreak,
|
||||
...withUIExtensions(withComments(richExtensions)),
|
||||
];
|
||||
|
||||
type Props = Omit<EditorProps, "editorStyle"> & {
|
||||
onChangeTitle: (title: string) => void;
|
||||
|
||||
@@ -16,6 +16,7 @@ import useQuery from "~/hooks/useQuery";
|
||||
import useStores from "~/hooks/useStores";
|
||||
import { type Editor as TEditor } from "~/editor";
|
||||
import { ChangesetHelper } from "@shared/editor/lib/ChangesetHelper";
|
||||
import CodeWordBreak from "@shared/editor/extensions/CodeWordBreak";
|
||||
|
||||
type Props = Omit<EditorProps, "extensions"> & {
|
||||
/** The ID of the revision */
|
||||
@@ -84,6 +85,7 @@ function RevisionViewer(props: Props, ref: React.Ref<TEditor>) {
|
||||
comparisonData
|
||||
);
|
||||
return [
|
||||
CodeWordBreak,
|
||||
...withComments(richExtensions),
|
||||
...(showChanges && changeset?.changes
|
||||
? [new Diff({ changes: changeset?.changes })]
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import { codeWordDecorations } from "../plugins/CodeWordDecorationsPlugin";
|
||||
import Extension from "../lib/Extension";
|
||||
|
||||
export default class CodeWordBreak extends Extension {
|
||||
get name() {
|
||||
return "codeWordBreak";
|
||||
}
|
||||
|
||||
get plugins() {
|
||||
return [codeWordDecorations()];
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,6 @@ import { markInputRuleForPattern } from "../lib/markInputRule";
|
||||
import type { MarkdownSerializerState } from "../lib/markdown/serializer";
|
||||
import { isInCode } from "../queries/isInCode";
|
||||
import Mark from "./Mark";
|
||||
import { codeWordDecorations } from "../plugins/CodeWordDecorationsPlugin";
|
||||
|
||||
export default class Code extends Mark {
|
||||
get name() {
|
||||
@@ -110,7 +109,6 @@ export default class Code extends Mark {
|
||||
|
||||
return [
|
||||
codeCursorPlugin,
|
||||
codeWordDecorations(),
|
||||
new Plugin({
|
||||
props: {
|
||||
// Typing a character inside of two backticks will wrap the character
|
||||
|
||||
@@ -32,7 +32,7 @@ import {
|
||||
} from "../commands/codeFence";
|
||||
import { selectAll } from "../commands/selectAll";
|
||||
import toggleBlockType from "../commands/toggleBlockType";
|
||||
import { CodeHighlighting } from "../extensions/CodeHighlighting";
|
||||
import { CodeHighlighting } from "../plugins/CodeHighlightingPlugin";
|
||||
import Mermaid, {
|
||||
pluginKey as mermaidPluginKey,
|
||||
type MermaidState,
|
||||
|
||||
File renamed without changes.
Reference in new issue
Block a user