mirror of https://github.com/fantasticit/think.git
Merge pull request #21 from fantasticit/bugfix/title
commit
e7a70622d4
|
@ -19,8 +19,6 @@ declare module '@tiptap/core' {
|
|||
export const Title = Node.create<TitleOptions>({
|
||||
name: 'title',
|
||||
content: 'inline*',
|
||||
group: 'block',
|
||||
defining: true,
|
||||
|
||||
addOptions() {
|
||||
return {
|
||||
|
@ -61,11 +59,12 @@ export const Title = Node.create<TitleOptions>({
|
|||
|
||||
const $head = state.selection.$head;
|
||||
const titleNode = $head.node($head.depth);
|
||||
const insertPos = titleNode.firstChild.nodeSize + 1;
|
||||
dispatch(state.tr.insert(insertPos, paragraph.create()));
|
||||
const endPos = titleNode.firstChild.nodeSize + 1;
|
||||
|
||||
dispatch(state.tr.insert(endPos, paragraph.create()));
|
||||
|
||||
const newState = view.state;
|
||||
const next = new TextSelection(newState.doc.resolve(insertPos + 1));
|
||||
const next = new TextSelection(newState.doc.resolve(endPos + 2));
|
||||
dispatch(newState.tr.setSelection(next));
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
code {
|
||||
padding: 4px;
|
||||
font-family: Consolas, Menlo, Courier, monospace;
|
||||
font-size: .875rem;
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.3;
|
||||
cursor: text;
|
||||
background-color: var(--semi-color-fill-1);
|
||||
|
@ -25,7 +25,7 @@
|
|||
padding: 0;
|
||||
margin: 8px;
|
||||
overflow: auto;
|
||||
font-size: .875rem;
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.5rem;
|
||||
color: inherit;
|
||||
white-space: pre;
|
||||
|
@ -33,6 +33,12 @@
|
|||
overscroll-behavior: contain;
|
||||
}
|
||||
}
|
||||
|
||||
.node-codeBlock {
|
||||
&::before {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -276,6 +282,6 @@ body[theme-mode='dark'] {
|
|||
}
|
||||
|
||||
img {
|
||||
opacity: .75;
|
||||
opacity: 0.75;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
.wrap {
|
||||
position: relative;
|
||||
margin-top: 0.75em;
|
||||
|
||||
.handleWrap {
|
||||
display: flex;
|
||||
|
|
Loading…
Reference in New Issue