mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-08 09:26:42 +00:00
e711290d8b
Had to do some manual fixing of the app.js file due to misplaced comments
31 lines
524 B
JavaScript
31 lines
524 B
JavaScript
import {
|
|
init,
|
|
attributesModule,
|
|
toVNode,
|
|
} from 'snabbdom';
|
|
|
|
let patcher;
|
|
|
|
/**
|
|
* @returns {Function}
|
|
*/
|
|
function getPatcher() {
|
|
if (patcher) return patcher;
|
|
|
|
patcher = init([
|
|
attributesModule,
|
|
]);
|
|
|
|
return patcher;
|
|
}
|
|
|
|
/**
|
|
* @param {Element} domTarget
|
|
* @param {String} html
|
|
*/
|
|
export function patchDomFromHtmlString(domTarget, html) {
|
|
const contentDom = document.createElement('div');
|
|
contentDom.innerHTML = html;
|
|
getPatcher()(toVNode(domTarget), toVNode(contentDom));
|
|
}
|