FIX: set correct options while initializing PrettyText
Dieser Commit ist enthalten in:
Ursprung
aca0fab74e
Commit
40c0c12719
1 geänderte Dateien mit 10 neuen und 1 gelöschten Zeilen
|
@ -1,8 +1,17 @@
|
||||||
import loadScript from "./load-script";
|
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 Handlebars from "handlebars";
|
||||||
|
import getURL from "discourse-common/lib/get-url";
|
||||||
|
import { getOwner } from "discourse-common/lib/get-owner";
|
||||||
|
|
||||||
export function cook(text, options) {
|
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));
|
return new Handlebars.SafeString(new PrettyText(options).cook(text));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Laden …
In neuem Issue referenzieren