0

我正在使用 git Repo 的克隆: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));
}

但这不会将结束标签添加到 image 和 br 标签

4

1 回答 1

1

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

juicePreserveTags: {
  imgTag: { "start": "<img", "end": "/>" }, 
  brTag: { "start": "<br", "end": "/>" }
},
于 2021-01-05T08:51:36.667 回答