[chore] Add JSDoc

This commit is contained in:
Cohee 2024-10-18 19:46:37 +03:00
parent 80f91d129e
commit 9c379125be

View File

@ -18,8 +18,13 @@ function sanitizeInlineQuotationOnCopy() {
const range = selection.getRangeAt(0).cloneContents(); const range = selection.getRangeAt(0).cloneContents();
const tempDOM = document.createDocumentFragment(); const tempDOM = document.createDocumentFragment();
/**
* Process a node, transforming <q> elements to <span> elements and preserving children.
* @param {Node} node Input node
* @returns {Node} Processed node
*/
function processNode(node) { function processNode(node) {
if (node.nodeType === Node.ELEMENT_NODE && node.tagName.toLowerCase() === 'q') { if (node.nodeType === Node.ELEMENT_NODE && node.nodeName.toLowerCase() === 'q') {
// Transform <q> to <span>, preserve children // Transform <q> to <span>, preserve children
const span = document.createElement('span'); const span = document.createElement('span');