mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 00:16:15 -04:00
Pad: Plumb author ID through mutation operations
This commit is contained in:
parent
5f60b3aab2
commit
3b8549342a
7 changed files with 35 additions and 30 deletions
|
@ -27,7 +27,7 @@ const supportedElems = require('../../static/js/contentcollector').supportedElem
|
|||
|
||||
const logger = log4js.getLogger('ImportEtherpad');
|
||||
|
||||
exports.setPadRaw = async (padId, r) => {
|
||||
exports.setPadRaw = async (padId, r, authorId = '') => {
|
||||
const records = JSON.parse(r);
|
||||
|
||||
// get supported block Elements from plugins, we will use this later.
|
||||
|
@ -110,7 +110,7 @@ exports.setPadRaw = async (padId, r) => {
|
|||
return v;
|
||||
},
|
||||
});
|
||||
await pad.init();
|
||||
await pad.init(null, authorId);
|
||||
await pad.check();
|
||||
|
||||
await Promise.all([
|
||||
|
|
|
@ -23,7 +23,7 @@ const jsdom = require('jsdom');
|
|||
const apiLogger = log4js.getLogger('ImportHtml');
|
||||
let processor;
|
||||
|
||||
exports.setPadHTML = async (pad, html) => {
|
||||
exports.setPadHTML = async (pad, html, authorId = '') => {
|
||||
if (processor == null) {
|
||||
const [{rehype}, {default: minifyWhitespace}] =
|
||||
await Promise.all([import('rehype'), import('rehype-minify-whitespace')]);
|
||||
|
@ -88,6 +88,6 @@ exports.setPadHTML = async (pad, html) => {
|
|||
const theChangeset = builder.toString();
|
||||
|
||||
apiLogger.debug(`The changeset: ${theChangeset}`);
|
||||
await pad.setText('\n');
|
||||
await pad.appendRevision(theChangeset);
|
||||
await pad.setText('\n', authorId);
|
||||
await pad.appendRevision(theChangeset, authorId);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue