Closed zzfn closed 1 year ago
Hi,你说的生成的 Code 中会出现分号指的是?
Hi, 我用 PR 里的修改在本地跑了下,观察到最后的产物 markdownAst
转换后的代码还是带「分号」的。
分号指?这个分号吗 观察生成的代码
我是跑的单元测试 yarn run test
。你截图里的「生成的代码」是在哪一行生成的。最终产物里 %%Content%% 应该是会被替换掉的呀。
背景是这样的 ,我参考arco-cli代码 在 ## API前插入ast,把replaceWith
替换成insertBefore
发现的这个问题,本仓库使用replaceWith
是不会出现分号问题,觉得pr方案严谨些(笑(逃
Types of changes
Background and context
现在是替换
%%content%%
,当尝试自动在生成的PROPS前插入时,会出现“;”分号。现有情况下,replaceWith的是ExpressionStatement,当改为insertBefore ExpressionStatement。生成的code中会出现“;” 分号 insertBefore JSXElement则表现正确![image](https://user-images.githubusercontent.com/44751363/183272725-d0bfc423-255f-4bf5-ba71-363edda049c3.png)
Solution
How is the change tested?
Changelog
Checklist:
feature
branch and others should be submitted tomaster
branch)Other information