在 MJML Gulp 任务中使用 juicePreserveTags 选项添加自动关闭标签

Add self-closing tags using juicePreserveTags options within an MJML Gulp task

我正在使用 git 存储库的克隆:https://github.com/jpagano/mjml-starter-base

如何添加在此处找到的配置选项https://www.gitmemory.com/issue/mjmlio/mjml/1528/467101657

config.juicePreserveTags='{"imgTag": { "start": "<img", "end": "/>" }, "brTag": { "start": "<br", "end": "/>" }}'

我试过了:

export function buildMjml() {
  const options = {
    beautify: true,
    minify: false,
    keepComments: false,
    juicePreserveTags: '{"imgTag": { "start": "<img", "end": "/>" }, "brTag": { "start": "<br", "end": "/>" }}',
  };

  return gulp.src(PATHS.mjml.src).pipe(mjmlGulp(mjml, options)).pipe(gulp.dest(PATHS.dist));
}

但这不会将结束标记添加到图像和 br 标记

选项应设置为有效的 js 对象。

juicePreserveTags: {
  imgTag: { "start": "<img", "end": "/>" }, 
  brTag: { "start": "<br", "end": "/>" }
},