【发布时间】:2019-05-16 18:10:15
【问题描述】:
在 YML 中使用 HTML 会产生 [Objcet Object]
YML
context:
fieldLabel: |
<strong>
Some Bold Text
</strong> and now normal continued.
它呈现为
context:
fieldLabel: ",[object Object], and now normal continued.↵"
但我希望我的输出应该是
context: { fieldLabel: '<strong>\n Some Bold Text\n</strong> and now normal continued.\n' },
我的 JS 代码:
我的 JS 代码:
const tests = YAML.safeLoad(this.props.children,{json:true});
console.log("tests",...tests)
控制台输出:
context:
fieldLabel: ",[object Object], and now normal continued.↵"
它以 [object Object] 的形式出现,而不是 <strong>\n Some Bold Text\n</strong>
【问题讨论】:
标签: javascript yaml remarkjs