Skip to content

Commit

Permalink
Merge pull request #12461 from ckeditor/ck/12430-nonblock-elements-in…
Browse files Browse the repository at this point in the history
…-schema

Fix (html-support): Redefine most GHS-elements as not blocks in schema. Closes #12430.
  • Loading branch information
scofalik committed Sep 15, 2022
2 parents 9ff9d44 + 7366e52 commit d9500fe
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 31 deletions.
63 changes: 34 additions & 29 deletions packages/ckeditor5-html-support/src/schemadefinitions.js
Expand Up @@ -135,23 +135,23 @@ export default {
view: 'tbody',
modelSchema: {
allowIn: 'htmlTable',
isBlock: true
isBlock: false
}
},
{
model: 'htmlThead',
view: 'thead',
modelSchema: {
allowIn: 'htmlTable',
isBlock: true
isBlock: false
}
},
{
model: 'htmlTfoot',
view: 'tfoot',
modelSchema: {
allowIn: 'htmlTable',
isBlock: true
isBlock: false
}
},
{
Expand All @@ -160,7 +160,7 @@ export default {
modelSchema: {
allowIn: 'htmlTable',
allowChildren: '$text',
isBlock: true
isBlock: false
}
},
{
Expand All @@ -169,22 +169,23 @@ export default {
modelSchema: {
allowIn: 'htmlTable',
allowChildren: 'col',
isBlock: true
isBlock: false
}
},
{
model: 'htmlCol',
view: 'col',
modelSchema: {
allowIn: 'htmlColgroup',
isBlock: true
isBlock: false
}
},
{
model: 'htmlTr',
view: 'tr',
modelSchema: {
allowIn: [ 'htmlTable', 'htmlThead', 'htmlTbody' ]
allowIn: [ 'htmlTable', 'htmlThead', 'htmlTbody' ],
isLimit: true
}
},
// TODO can also include text.
Expand All @@ -193,7 +194,9 @@ export default {
view: 'td',
modelSchema: {
allowIn: 'htmlTr',
allowContentOf: '$container'
allowContentOf: '$container',
isLimit: true,
isBlock: false
}
},
// TODO can also include text.
Expand All @@ -202,7 +205,9 @@ export default {
view: 'th',
modelSchema: {
allowIn: 'htmlTr',
allowContentOf: '$container'
allowContentOf: '$container',
isLimit: true,
isBlock: false
}
},
// TODO can also include text.
Expand All @@ -211,7 +216,7 @@ export default {
view: 'figure',
modelSchema: {
inheritAllFrom: '$container',
isBlock: true
isBlock: false
}
},
// TODO can also include other block elements.
Expand All @@ -221,7 +226,7 @@ export default {
modelSchema: {
allowIn: 'htmlFigure',
allowChildren: '$text',
isBlock: true
isBlock: false
}
},
// TODO can also include text.
Expand All @@ -230,7 +235,7 @@ export default {
view: 'address',
modelSchema: {
inheritAllFrom: '$container',
isBlock: true
isBlock: false
}
},
// TODO can also include text.
Expand All @@ -239,7 +244,7 @@ export default {
view: 'aside',
modelSchema: {
inheritAllFrom: '$container',
isBlock: true
isBlock: false
}
},
// TODO can also include text.
Expand All @@ -248,7 +253,7 @@ export default {
view: 'main',
modelSchema: {
inheritAllFrom: '$container',
isBlock: true
isBlock: false
}
},
// TODO can also include text.
Expand All @@ -257,7 +262,7 @@ export default {
view: 'details',
modelSchema: {
inheritAllFrom: '$container',
isBlock: true
isBlock: false
}
},
{
Expand All @@ -266,7 +271,7 @@ export default {
modelSchema: {
allowChildren: '$text',
allowIn: 'htmlDetails',
isBlock: true
isBlock: false
}
},
{
Expand All @@ -283,7 +288,7 @@ export default {
view: 'fieldset',
modelSchema: {
inheritAllFrom: '$container',
isBlock: true
isBlock: false
}
},
// TODO can also include h1-h6.
Expand All @@ -301,7 +306,7 @@ export default {
view: 'header',
modelSchema: {
inheritAllFrom: '$container',
isBlock: true
isBlock: false
}
},
// TODO can also include text.
Expand All @@ -310,7 +315,7 @@ export default {
view: 'footer',
modelSchema: {
inheritAllFrom: '$container',
isBlock: true
isBlock: false
}
},
// TODO can also include text.
Expand All @@ -334,7 +339,7 @@ export default {
'htmlH5',
'htmlH6'
],
isBlock: true
isBlock: false
}
},
{
Expand Down Expand Up @@ -384,7 +389,7 @@ export default {
modelSchema: {
allowWhere: '$container',
allowChildren: [ '$htmlList', 'htmlLi' ],
isBlock: true
isBlock: false
}
},
{
Expand Down Expand Up @@ -422,7 +427,7 @@ export default {
modelSchema: {
allowIn: '$htmlList',
allowChildren: '$text',
isBlock: true
isBlock: false
}
},
{
Expand All @@ -437,15 +442,15 @@ export default {
view: 'article',
modelSchema: {
inheritAllFrom: '$container',
isBlock: true
isBlock: false
}
},
{
model: 'htmlSection',
view: 'section',
modelSchema: {
inheritAllFrom: '$container',
isBlock: true
isBlock: false
}
},
// TODO can also include text.
Expand All @@ -454,7 +459,7 @@ export default {
view: 'nav',
modelSchema: {
inheritAllFrom: '$container',
isBlock: true
isBlock: false
}
},
{
Expand All @@ -463,31 +468,31 @@ export default {
modelSchema: {
allowWhere: '$container',
allowChildren: [ 'htmlDt', 'htmlDd' ],
isBlock: true
isBlock: false
}
},
{
model: 'htmlDt',
view: 'dt',
modelSchema: {
allowChildren: '$block',
isBlock: true
isBlock: false
}
},
{
model: 'htmlDd',
view: 'dd',
modelSchema: {
allowChildren: '$block',
isBlock: true
isBlock: false
}
},
{
model: 'htmlCenter',
view: 'center',
modelSchema: {
inheritAllFrom: '$container',
isBlock: true
isBlock: false
}
}
],
Expand Down
4 changes: 2 additions & 2 deletions packages/ckeditor5-html-support/tests/integrations/heading.js
Expand Up @@ -92,7 +92,7 @@ describe( 'HeadingElementSupport', () => {
'heading2',
'otherHeading'
],
isBlock: true
isBlock: false
},
isBlock: true
} ] );
Expand Down Expand Up @@ -446,7 +446,7 @@ describe( 'HeadingElementSupport', () => {
'htmlH5',
'htmlH6'
],
isBlock: true
isBlock: false
},
isBlock: true
} ] );
Expand Down

0 comments on commit d9500fe

Please sign in to comment.