forked from mystiq/hydrogen-web
Pass parameters to parseHTMLBody directly instead of via object.
This commit is contained in:
parent
c261b9fb23
commit
fd17ffecfb
2 changed files with 2 additions and 2 deletions
|
@ -165,7 +165,7 @@ const sanitizeConfig = {
|
||||||
allowedSchemes: [ "http", "https", "ftp", "mailto", "tel", "mxc" ]
|
allowedSchemes: [ "http", "https", "ftp", "mailto", "tel", "mxc" ]
|
||||||
};
|
};
|
||||||
|
|
||||||
export function parseHTMLBody({ mediaRepository, platform }, html) {
|
export function parseHTMLBody(platform, mediaRepository, html) {
|
||||||
const parseResult = platform.parseHTML(sanitizeHtml(html, sanitizeConfig));
|
const parseResult = platform.parseHTML(sanitizeHtml(html, sanitizeConfig));
|
||||||
const deserializer = new Deserializer(parseResult, mediaRepository);
|
const deserializer = new Deserializer(parseResult, mediaRepository);
|
||||||
const parts = deserializer.parseNodes(parseResult.rootNodes);
|
const parts = deserializer.parseNodes(parseResult.rootNodes);
|
||||||
|
|
|
@ -49,7 +49,7 @@ export class TextTile extends BaseTextTile {
|
||||||
|
|
||||||
_parseBody(body, format) {
|
_parseBody(body, format) {
|
||||||
if (format === "html") {
|
if (format === "html") {
|
||||||
return parseHTMLBody({ mediaRepository: this._mediaRepository, platform: this.platform }, body);
|
return parseHTMLBody(this.platform, this._mediaRepository, body);
|
||||||
} else {
|
} else {
|
||||||
return parsePlainBody(body);
|
return parsePlainBody(body);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue