1
0
Fork 0

Merge pull request #108 from paviliondev/upload-prettytext

FIX: set correct options while initializing PrettyText
Dieser Commit ist enthalten in:
Angus McLeod 2021-05-10 19:05:49 +12:00 committet von GitHub
Commit 580cc55445
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -1,8 +1,17 @@
import loadScript from "./load-script";
import { default as PrettyText } from "pretty-text/pretty-text";
import { default as PrettyText, buildOptions } from "pretty-text/pretty-text";
import Handlebars from "handlebars";
import getURL from "discourse-common/lib/get-url";
import { getOwner } from "discourse-common/lib/get-owner";
export function cook(text, options) {
if (!options) {
options = buildOptions({
getURL: getURL,
siteSettings: getOwner(this).lookup("site-settings:main"),
});
}
return new Handlebars.SafeString(new PrettyText(options).cook(text));
}