Skip to content

Commit

Permalink
Editor basic: insert paragraph instead of heading as default top-leve…
Browse files Browse the repository at this point in the history
…l element #9527
  • Loading branch information
stissot committed Mar 30, 2023
1 parent cdc9f00 commit c6a55b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function getProsemirrorContent(fixture: ComponentFixture<TestHostComponent>): st
}

const html = `<h1>h1</h1>
<h2>h1</h2>
<h2>h2</h2>
<h3>h3</h3>
<h4>h4</h4>
<h5>h5</h5>
Expand Down Expand Up @@ -77,7 +77,7 @@ describe('NaturalEditorComponent', () => {
fixture.detectChanges();

const expected = `<h1>h1</h1>
<h2>h1</h2>
<h2>h2</h2>
<h3>h3</h3>
<h4>h4</h4>
<h5>h5</h5>
Expand Down Expand Up @@ -116,12 +116,12 @@ describe('NaturalEditorComponent', () => {
hostComponent.myValue = html;
fixture.detectChanges();
const expected = `<h1>h1</h1>
<h2>h1</h2>
<h2>h2</h2>
<h3>h3</h3>
<h4>h4</h4>
<h5>h5</h5>
<h6>h6</h6>
<h1>code</h1>
<p>code</p>
<p>p"foo</p>
<p>right aligned</p>
<p><strong>strong</strong></p>
Expand Down
2 changes: 1 addition & 1 deletion projects/natural-editor/src/lib/utils/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import {tableNodes} from './table';
// Keep only basic elements
type BasicNodes = Omit<typeof nodes, 'image' | 'code_block' | 'blockquote' | 'horizontal_rule'>;
const basicNodes: BasicNodes = {
heading: nodes.heading,
doc: nodes.doc,
paragraph: nodes.paragraph,
heading: nodes.heading,
text: nodes.text,
hard_break: nodes.hard_break,
};
Expand Down

0 comments on commit c6a55b7

Please sign in to comment.