From 67ab3454ef2180ddc2b78e401c733e6279b810ef Mon Sep 17 00:00:00 2001 From: xiaodemen Date: Tue, 18 Jan 2022 12:41:50 +0800 Subject: [PATCH] fix: fix referring to refBlock in another refBlock Change-Id: Idb7c4c63c1e75e8bbd9b283045536eba5d4397d8 --- one/build/remark-ref.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/one/build/remark-ref.js b/one/build/remark-ref.js index 5a53daa..40924df 100644 --- a/one/build/remark-ref.js +++ b/one/build/remark-ref.js @@ -28,8 +28,7 @@ export default function attacher () { } visit(tree, NAME, ({ id, value }) => { - let { contents } = render(value, path, data) - data.refs[id] = contents + data.refs[id] = () => render(value, path, data).contents }) remove(tree, NAME) @@ -42,7 +41,7 @@ export default function attacher () { parent.children.splice(index, 1, { type: 'html', - value: data.refs[id] + value: data.refs[id]() }) }) }