Skip to content

Commit 678e598

Browse files
committed
Add newline support to formatting, resolve #17
1 parent 4a7a408 commit 678e598

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "logseq-hypothesis",
3-
"version": "0.2.3",
3+
"version": "0.2.4",
44
"main": "dist/index.html",
55
"author": "c6p",
66
"scripts": {

src/App.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,16 +198,19 @@ export default {
198198
let content = "";
199199
if (exact) {
200200
content += (highlightFormat || defaults.highlightFormat)
201+
.replace("\\n", "\n")
201202
.replace("{text}", exact)
202203
.replace("{tags}", tags);
203204
if (text)
204205
content +=
205206
"\n" +
206207
(annotationFormat || defaults.annotationFormat)
208+
.replace("\\n", "\n")
207209
.replace("{text}", text)
208210
.replace("{tags}", tags);
209211
} else {
210212
content += (noteFormat || defaults.noteFormat)
213+
.replace("\\n", "\n")
211214
.replace("{text}", text)
212215
.replace("{tags}", tags);
213216
}
@@ -218,7 +221,10 @@ export default {
218221
acc.push([
219222
r,
220223
{
221-
content: deletedFormat || defaults.deletedFormat,
224+
content: (deletedFormat || defaults.deletedFormat).replace(
225+
"\\n",
226+
"\n"
227+
),
222228
properties: { hid: r },
223229
parent: references[i - 1],
224230
},

0 commit comments

Comments
 (0)