Replies: 1 comment 3 replies
-
<% const ogDate = it.extra?.match(/original-date:\s*(\d+)/)?.[1]; if (ogDate) { %>
original-date: <%= ogDate %>
<% } %> |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
您好,感谢大佬的插件,非常好用!
请问下大佬,我如何可以自定义提取extra的内容。
extra中我输入了"original-date: 1997",我在模版中设定了:
original-date: <%= /original-date:\s*(\d+)/.exec(it.extra)[1] %>
当我的文献中extra中没有输入original-date相关信息的时候,这个命令会出错,模版无法执行。在有这个数据的时候,输出是正常的。
另外,若是extra中我添加了多行的类似数据应该如何执行呢?例如,当extra中有:“Original Author: James C. Scott
Original Title: Seeing Like a State: How Certain Schemes to Improve the Human Condition Have Failed”这样的内容的时候呢?
谢谢!
Beta Was this translation helpful? Give feedback.
All reactions