Fix Prettier formatting in editor-schema (#24)
All checks were successful
CD / Build and push images (push) Successful in 1m50s
CI / Lint, typecheck, test (push) Successful in 1m23s
CI / Auth e2e pack (push) Successful in 1m42s
CI / Build container images (push) Has been skipped
CD / Deploy to Test (push) Successful in 8s
CD / Smoke tests against Test (push) Successful in 1m4s
CD / Promote to Int (push) Successful in 10s
All checks were successful
CD / Build and push images (push) Successful in 1m50s
CI / Lint, typecheck, test (push) Successful in 1m23s
CI / Auth e2e pack (push) Successful in 1m42s
CI / Build container images (push) Has been skipped
CD / Deploy to Test (push) Successful in 8s
CD / Smoke tests against Test (push) Successful in 1m4s
CD / Promote to Int (push) Successful in 10s
The #24 commit passed ESLint but not the repo's Prettier check (pnpm lint runs both) — CI caught it after the push. Formatting only, no behavior change.
This commit is contained in:
parent
b89aa6bed0
commit
b0d9a00c18
@ -15,10 +15,14 @@ describe('docToHtml (issue #24)', () => {
|
|||||||
|
|
||||||
it('renders inline marks and a table', () => {
|
it('renders inline marks and a table', () => {
|
||||||
const doc = markdownToDoc('**bold** and *italic* and `code`');
|
const doc = markdownToDoc('**bold** and *italic* and `code`');
|
||||||
expect(docToHtml(doc)).toBe('<p><strong>bold</strong> and <em>italic</em> and <code>code</code></p>');
|
expect(docToHtml(doc)).toBe(
|
||||||
|
'<p><strong>bold</strong> and <em>italic</em> and <code>code</code></p>',
|
||||||
|
);
|
||||||
|
|
||||||
const table = markdownToDoc('| A | B |\n| --- | --- |\n| 1 | 2 |');
|
const table = markdownToDoc('| A | B |\n| --- | --- |\n| 1 | 2 |');
|
||||||
expect(docToHtml(table)).toBe('<table><tr><th><p>A</p></th><th><p>B</p></th></tr><tr><td><p>1</p></td><td><p>2</p></td></tr></table>');
|
expect(docToHtml(table)).toBe(
|
||||||
|
'<table><tr><th><p>A</p></th><th><p>B</p></th></tr><tr><td><p>1</p></td><td><p>2</p></td></tr></table>',
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('allowlists link protocols, neutralizing javascript: hrefs', () => {
|
it('allowlists link protocols, neutralizing javascript: hrefs', () => {
|
||||||
|
|||||||
@ -66,7 +66,8 @@ export const editorSchema = new Schema({
|
|||||||
content: 'list_item+',
|
content: 'list_item+',
|
||||||
attrs: { order: { default: 1, validate: 'number' } },
|
attrs: { order: { default: 1, validate: 'number' } },
|
||||||
parseDOM: [{ tag: 'ol' }],
|
parseDOM: [{ tag: 'ol' }],
|
||||||
toDOM: (node) => (node.attrs.order === 1 ? ['ol', 0] : ['ol', { start: node.attrs.order }, 0]),
|
toDOM: (node) =>
|
||||||
|
node.attrs.order === 1 ? ['ol', 0] : ['ol', { start: node.attrs.order }, 0],
|
||||||
},
|
},
|
||||||
|
|
||||||
list_item: {
|
list_item: {
|
||||||
@ -86,7 +87,11 @@ export const editorSchema = new Schema({
|
|||||||
content: 'paragraph block*',
|
content: 'paragraph block*',
|
||||||
attrs: { checked: { default: false, validate: 'boolean' } },
|
attrs: { checked: { default: false, validate: 'boolean' } },
|
||||||
parseDOM: [{ tag: 'li[data-type="task_item"]' }],
|
parseDOM: [{ tag: 'li[data-type="task_item"]' }],
|
||||||
toDOM: (node) => ['li', { 'data-type': 'task_item', 'data-checked': String(node.attrs.checked) }, 0],
|
toDOM: (node) => [
|
||||||
|
'li',
|
||||||
|
{ 'data-type': 'task_item', 'data-checked': String(node.attrs.checked) },
|
||||||
|
0,
|
||||||
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
text: { group: 'inline' },
|
text: { group: 'inline' },
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user