Skip to content

Commit

Permalink
feat: conversion of busycal events to standard links added (#528)
Browse files Browse the repository at this point in the history
  • Loading branch information
akosbalasko authored Sep 18, 2023
1 parent f1733b8 commit c0dace3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/utils/turndown-rules/internal-links-rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const wikiStyleLinksRule = {
? `![[${realValue}]]`
: getShortLinkIfPossible(token, value);
}
if (value.match(/^(https?:|tel:|www\.|file:|ftp:|mailto:)/) && !value.startsWith("https://www.evernote.com")) {
if (value.match(/^(https?:|tel:|www\.|file:|busycalevent:|ftp:|mailto:)/) && !value.startsWith("https://www.evernote.com")) {
return getShortLinkIfPossible(token, value);
}

Expand Down
4 changes: 2 additions & 2 deletions test/data/link to telephone 202-555-0179.enex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE en-export SYSTEM "http://xml.evernote.com/pub/evernote-export4.dtd">
<en-export export-date="20231016T164742Z" application="Evernote" version="10.61.5">
<en-export export-date="20231018T170555Z" application="Evernote" version="10.61.10">
<note>
<title>link to telephone: 202-555-0179</title>
<created>20230916T163526Z</created>
Expand All @@ -10,7 +10,7 @@
</note-attributes>
<content>
<![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd"><en-note><div>link to telephone: <a href="tel:202-555-0179">202-555-0179</a></div><div>link: <a href="https://google.com">Google</a></div></en-note> ]]>
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd"><en-note><div>link to telephone: <a href="tel:202-555-0179" rev="en_rl_none">202-555-0179</a></div><div>link: <a href="https://google.com" rev="en_rl_none">Google</a></div><div>busycal link: <a href="busycalevent://new/Meeting%20with%20Joe%20June%207%20at%203pm%20%2FWork">event</a></div></en-note> ]]>
</content>
</note>
</en-export>
1 change: 1 addition & 0 deletions test/data/link to telephone_ 202-555-0179.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

link to telephone: [202-555-0179](tel:202-555-0179)
link: [Google](https://google.com)
busycal link: [event](busycalevent://new/Meeting%20with%20Joe%20June%207%20at%203pm%20%2FWork)

Created at: 2023-09-16T17:35:26+01:00
Updated at: 2023-09-16T17:47:41+01:00
Expand Down
1 change: 0 additions & 1 deletion test/yarle-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ export const yarleTests: Array<YarleTest> = [
useZettelIdAsFilename: false
},
testOutputPath: `notes${path.sep}link to telephone 202-555-0179${path.sep}202309161735 link to telephone_ 202-555-0179.md`,

expectedOutputPath: `${dataFolder}link to telephone_ 202-555-0179.md`,
},
{
Expand Down

0 comments on commit c0dace3

Please sign in to comment.