fix: handle someone passing in nothing
This commit is contained in:
parent
94af047527
commit
32cec2baab
1 changed files with 1 additions and 1 deletions
2
public/js/external/md_to_html.js
vendored
2
public/js/external/md_to_html.js
vendored
|
|
@ -68,7 +68,7 @@ const MD_TRANSFORMS = {
|
|||
* @returns The generated HTML string.
|
||||
*/
|
||||
function md_to_html(markdown, transform_config) {
|
||||
let html = markdown;
|
||||
let html = markdown ?? "";
|
||||
for (const transform_name of MD_TRANSFORM_NAMES) {
|
||||
const enabled =
|
||||
typeof transform_config === "undefined" || transform_config[transform_name] !== false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue