Skip to content
Snippets Groups Projects
Commit a2a8c73c authored by Loïc Correnson's avatar Loïc Correnson Committed by David Bühler
Browse files

[ivette/richtext] fix richtext buffer self-destruction

parent 982d0477
No related branches found
No related tags found
No related merge requests found
......@@ -54,16 +54,14 @@ export function printTextWithTags(
): void {
if (Array.isArray(text)) {
let marker = false;
const tag = text.shift();
if (tag) {
if (Array.isArray(tag)) {
text.unshift(tag);
} else {
buffer.openTextMarker({ id: tag, ...options ?? {} });
marker = true;
}
const tag = text[0];
if (typeof (tag) === 'string') {
buffer.openTextMarker({ id: tag, ...options ?? {} });
marker = true;
}
for (let k = marker ? 1 : 0; k < text.length; k++) {
printTextWithTags(buffer, text[k], options);
}
text.forEach((txt) => printTextWithTags(buffer, txt, options));
if (marker) {
marker = false;
buffer.closeTextMarker();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment