Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions tests/functions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,28 @@ describe("replaceContentWithPageLinks()", () => {
`This block implicitly contains unicode words like [[가나다]].`
);
});

it("should replace links made up of CJKV characters", () => {
let [content, update] = replaceContentWithPageLinks(
["书架"],
`This block implicitly contains CJKV words like 书架.`,
false,
false
);
expect(content).toBe(
`This block implicitly contains CJKV words like [[书架]].`
);
});

it("should replace links made up of CJKV characters with tags", () => {
let [content, update] = replaceContentWithPageLinks(
["书架"],
`This block implicitly contains CJKV words like 书架.`,
true,
false
);
expect(content).toBe(
`This block implicitly contains CJKV words like #书架.`
);
});
});