Skip to content

Commit dfa969f

Browse files
authored
Merge pull request #116 from WoltLab/bugfix/block-qoute-text
Fix when meta-code elements are inside a blockQuote element
2 parents ca0aa47 + e6f2d4a commit dfa969f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

plugins/ckeditor5-woltlab-metacode/src/woltlabmetacode.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,16 @@ export class WoltlabMetacode extends Plugin {
7676
this.#serializedAttributesToString(attributes);
7777
const openingTag = writer.createText(`[${name}${attributeString}]`);
7878
const closingTag = writer.createText(`[/${name}]`);
79+
const parent = modelCursor.parent;
7980

8081
// Check if the BBCode appears to be a block element.
8182
let isBlockElement = false;
8283
const ancestors = modelCursor.getAncestors();
8384
if (ancestors[ancestors.length - 1].name === "$root") {
8485
isBlockElement = true;
86+
} else if (parent.name === "blockQuote") {
87+
// Text nodes may only appear inside block nodes.
88+
isBlockElement = true;
8589
} else {
8690
for (const child of viewItem.getChildren()) {
8791
if (child.is("containerElement")) {

0 commit comments

Comments
 (0)