Skip to content

fix: check for null value in normalizaDOM()#76

Open
ryicoh wants to merge 1 commit intoaguingand:mainfrom
ryicoh:fix/normaliza-dom
Open

fix: check for null value in normalizaDOM()#76
ryicoh wants to merge 1 commit intoaguingand:mainfrom
ryicoh:fix/normaliza-dom

Conversation

@ryicoh
Copy link
Copy Markdown

@ryicoh ryicoh commented Aug 15, 2024

el.nextSibling is nullable. so add to check for null value.

851 |     } = _ref2;
852 |     this.normalizeBlocks(node);
853 |     node.querySelectorAll("*").forEach((el) => {
854 |       var _el$nextSibling;
855 |       if (((_el$nextSibling = el.nextSibling) === null || _el$nextSibling === void 0 ? void 0 : _el$nextSibling.nodeType) === Node.TEXT_NODE && !el.closest("pre")) {
856 |         el.nextSibling.textContent = el.nextSibling.textContent.replace(/^\n/, "");
                                              ^
TypeError: null is not an object (evaluating 'el.nextSibling.textContent')

@ryicoh ryicoh force-pushed the fix/normaliza-dom branch from e3062c7 to b73972d Compare July 30, 2025 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant