PKM-er / obsidian-zotlit

A third-party project that aims to facilitate the integration between Obsidian.md and Zotero, by providing a set of community plugins for both Obsidian and Zotero.
https://zotlit.aidenlx.top
MIT License
589 stars 25 forks source link

模板的问题,换行问题 #278

Open xh542428798 opened 7 months ago

xh542428798 commented 7 months ago

您好,求助,我用以下的模板,想根据颜色分组,

<% const byColor = Object.groupBy(it, (annot) => annot.colorName);
const label = {
  "yellow": "前言素材",
   "#ffff00": "前言素材",
  "red": "方法参考",
  "green": "图注参考",
  "blue": "图片引用",
  "purple": "结果语句",
  "magenta": "讨论素材",
  "#cb97cb":"结果语句",
  "orange": "数据集",
    "gray": "其他",
};

const colorSet = new Set([...Object.keys(label), ...Object.keys(byColor)]);
for (const color of colorSet) { 
if (!(color in byColor)) continue -%>

### <%= label[color] ?? color %>

  <%_ for (const annot of byColor[color]) { %>
<%~ include("annotation", annot) %>

  <%_ } %>

<% } %>

显示的结果是同一个组里面没有换行,导致callout完全重叠: image

请问有什么解决办法吗

SimonJarry commented 6 months ago

<% for (const annot of byColor[color]) { %>
加入<!----> <%~ include("annotation", annot) %>
<%
} %>
<% } %>

xh542428798 commented 6 months ago

<% for (const annot of byColor[color]) { %>
加入<!----> <%~ include("annotation", annot) %>
<%
} %>
<% } %>

好的,谢谢