diff --git a/collector/utils/extensions/DrupalWiki/DrupalWiki/index.js b/collector/utils/extensions/DrupalWiki/DrupalWiki/index.js index 4de5e0e24fb..e9d7e777b6f 100644 --- a/collector/utils/extensions/DrupalWiki/DrupalWiki/index.js +++ b/collector/utils/extensions/DrupalWiki/DrupalWiki/index.js @@ -219,7 +219,9 @@ class DrupalWiki { pageId: pageId, accessToken: this.accessToken, }; - return `drupalwiki://${this.baseUrl}?payload=${encryptionWorker.encrypt( + return `drupalwiki://${ + this.baseUrl + }/node/${pageId}?payload=${encryptionWorker.encrypt( JSON.stringify(payload) )}`; } @@ -259,17 +261,27 @@ class DrupalWiki { * @private */ #processPageBody({ body, url, title, lastModified }) { - // use the title as content if there is none const textContent = body.trim() !== "" ? body : title; const plainTextContent = htmlToText(textContent, { wordwrap: false, preserveNewlines: true, + selectors: [ + { + selector: "table", + format: "dataTable", + options: { + colSpacing: 3, + rowSpacing: 1, + uppercaseHeaderCells: true, + maxColumnWidth: Infinity, + }, + }, + ], }); - // preserve structure + const plainBody = plainTextContent.replace(/\n{3,}/g, "\n\n"); - // add the link to the document - return `Link/URL: ${url}\n\n${plainBody}`; + return plainBody; } async #downloadAndProcessAttachments(pageId) {