Skip to content

Commit 4611ad7

Browse files
committed
Template formatting fix
1 parent 893c16c commit 4611ad7

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,12 @@ The highlight template exposes the following variables:
159159
#### Default highlight template
160160

161161
```markdown+nunjucks
162-
{{ text }}{%- if category == 'books' %} ([{{ location }}]({{ location_url }})){%- endif %}{%- if color %}%% Color: {{ color }} %%{%- endif %} ^{{ id }}
163-
{%- if note %}
162+
{{ text }}{%- if category == 'books' %} ([{{ location }}]({{ location_url }})){%- endif %}{%- if color %} %% Color: {{ color }} %%{%- endif %} ^{{id}}{%- if note %}
164163
165164
Note: {{ note }}
166165
{%- endif %}
166+
167+
---
167168
```
168169

169170
### Limitations

main.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,15 @@ Last Highlighted: *{{ last_highlight_at }}*
6262
6363
---
6464
65-
# Highlights
65+
# Highlights
6666
6767
`,
68-
highlightTemplate: `{{ text }}{%- if category == 'books' %} ([{{ location }}]({{ location_url }})){%- endif %}{%- if color %}%% Color: {{ color }} %%{%- endif %} ^{{ id }} %%
69-
{%- if note %}
68+
highlightTemplate: `{{ text }}{%- if category == 'books' %} ([{{ location }}]({{ location_url }})){%- endif %}{%- if color %} %% Color: {{ color }} %%{%- endif %} ^{{id}}{%- if note %}
7069
7170
Note: {{ note }}
7271
{%- endif %}
72+
73+
---
7374
`,
7475
};
7576

@@ -88,7 +89,7 @@ export default class ReadwiseMirror extends Plugin {
8889

8990
private formatHighlight(highlight: Highlight, book: Book) {
9091
const { id, text, note, location, color, url, tags, highlighted_at } = highlight;
91-
92+
9293
const locationUrl = `https://readwise.io/to_kindle?action=open&asin=${book['asin']}&location=${location}`;
9394

9495
const formattedTags = tags.filter((tag) => tag.name !== color);

0 commit comments

Comments
 (0)