Skip to content

Commit 279f8c9

Browse files
committed
Version 1.2.1 - fixes to refresh in rich editor
1 parent 385d6a8 commit 279f8c9

File tree

8 files changed

+39
-3
lines changed

8 files changed

+39
-3
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## v1.2.1 (2025-01-10)
4+
5+
- Added setting to stop the deletion of refresh metadata if extracted note is edited in the rich text editor
6+
- Added warning that any edits to an extracted paragraph with refresh will be overwritten
7+
8+
## v1.2.0 (2025-01-08)
9+
10+
- Fixed refresh metadata bugs
11+
312
## v1.1.9 (2025-01-06)
413

514
- 1.1.6/1.1.9 no code change - just republish to production

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Bullet and sub-bullet lists are treated as single paragraphs in Joplin. Settings
1212

1313
Any Joplin tags in the source notes will be combined as Joplin tags in the extracted note. Selected notes are not changed at all.
1414

15-
**Extracted notes can be refreshed from the source notes** if the setting to add extraction metadata is on. This will allow an extracted note to update if any of the source notes change. (NOTE: only one extracted note can be refrehed at a time).
15+
**Extracted notes can be refreshed from the source notes** if the setting to add extraction metadata is on. This will allow an extracted note to update if any of the source notes change. (NOTE: only one extracted note can be refrehed at a time. Also, if you use the rich text editor, you **must have the rich text metadata selection in settings turned on** so that the data isn't deleted if editing the extracted note).
1616

1717
## Installation
1818

@@ -59,6 +59,7 @@ Go to `Tools > Options > Paragraph Extractor`
5959
- `Remove extracted paragraph keyword and add end tag`: Any tagged/hashtagged keyword will be removed from the paragraph and an endtag will be added in the new extraction note. Removal assumes the keyword has a hashtag prefix character - otherwise the setting is ignored. The end tag is always appended when this is selected. Default `false`
6060
- `Append extracted note refresh metadata`: When paragraphs are extracted from one or many notes, the details of the plugin's settings and source note list will be appended as metadata in the form of a comment. This can be used to refresh an extracted note if the source note or notes change. Default `false`
6161
- `Append extracted note refresh metadata`: When paragraphs are extracted from one or many notes, the details of the plugin's settings and source note list will be appended as metadata in the form of a comment (unless the rich text compatibility option is selected which will make the metadata visible). This can be used to refresh an extracted note if the source note or notes change. Default `false`
62+
- `Enable rich text editor compatibility for refresh metadata`: If the rich text editor is used with note refresh - this must be enabled so that the appended refresh metadata isn't deleted when a refreshed note is edited within the rich editor. This does not need to be enabled if using only the markdown editor. Default `true`
6263
- `Title of the combined note`: New title of the combined note. Default `Extracted paragraphs`.
6364
- `Custom note title`: New note title with possible variables `{{FIRSTTITLE}}`, `{{LASTTITLE}}`, `{{ALLTITLE}}` and `{{DATE}}`.
6465

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "joplin-plugin-paragraph-extractor",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"scripts": {
55
"prepare": "npm run dist && husky install",
66
"dist": "webpack --env joplin-plugin-config=buildMain && webpack --env joplin-plugin-config=buildExtraScripts && webpack --env joplin-plugin-config=createArchive",

src/extractParagraphs.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,12 @@ namespace extractParagraphs {
169169
});
170170

171171
if (rnote.body.includes("-- pex|")) {
172+
const refreshWarning = await dialogs.showMessageBox(
173+
"Refreshing extracted notes will overwrite any changes. Do you wish to continue?"
174+
);
175+
if (refreshWarning > 0) {
176+
return;
177+
}
172178
footer = rnote.body.split("-- pex|");
173179
const chunks = footer[1].split("|");
174180
for (const chunk of chunks) {
@@ -221,6 +227,7 @@ namespace extractParagraphs {
221227
let extractAtBulletLevel = await joplin.settings.value(
222228
"extractAtBulletLevel"
223229
);
230+
let richtextMetaData = await joplin.settings.value("richtextMetaData");
224231
let ignoreCase = await joplin.settings.value("ignoreCase");
225232
let includeHeaders = await joplin.settings.value("includeHeaders");
226233
let refreshMetaData = await joplin.settings.value("refreshMetaData");
@@ -244,6 +251,7 @@ namespace extractParagraphs {
244251
refreshMetaData = pexSettings[6] === "0" ? false : true;
245252
tagPrefix = pexSettings[7];
246253
tagName = pexSettings[8];
254+
richtextMetaData = pexSettings[9] === "0" ? false : true;
247255
}
248256

249257
// collect note data
@@ -540,6 +548,9 @@ namespace extractParagraphs {
540548
const pexDate = now.getTime();
541549

542550
let pexHeader = "> <!-- pex";
551+
if (richtextMetaData) {
552+
pexHeader = "> < -- pex";
553+
}
543554
newNoteBody.push(
544555
pexHeader +
545556
"|s:" +
@@ -560,6 +571,8 @@ namespace extractParagraphs {
560571
tagPrefix +
561572
"," +
562573
tagName +
574+
"," +
575+
Number(richtextMetaData).toString() +
563576
"|n:" +
564577
nIDs.slice(0, -1) +
565578
"|d:" +

src/locales/de_DE.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"settings.replaceKeywordwithTagDescription": "Entfernt mit Tags versehene Schlüsselwörter (wird ignoriert, wenn kein Tag-Präfix vorhanden ist) aus dem extrahierten Absatz und fügt sie als Hashtag am Ende der kombinierten Notiz hinzu.",
44
"settings.refreshMetaData": "Extrahierte Notizaktualisierungsmetadaten anhängen",
55
"settings.refreshMetaDataDescription": "Extrahierte Notizeinstellungen und Notizliste zum Aktualisieren am Ende der Notiz hinzufügen",
6+
"settings.richtextMetaData": "Aktivieren Sie die Rich-Text-Editor-Kompatibilität zum Aktualisieren von Metadaten",
7+
"settings.richtextMetaDataDescription": "Verhindern Sie, dass Aktualisierungsmetadaten automatisch vom Rich-Text-Editor gelöscht werden",
68
"settings.extractAtBulletLevel": "Extrahieren Sie Inhalte auf der Ebene der Aufzählungslistenelemente",
79
"settings.extractAtBulletLevelDescription": "Extrahiert nur die Aufzählungszeile mit dem Schlüsselwort und nicht die vollständige Aufzählungsliste des Absatzes.",
810
"settings.ignoreCase": "Ignorieren Sie die Groß-/Kleinschreibung des Schlüsselworts",

src/locales/en_US.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"settings.replaceKeywordwithTagDescription": "Removes keywords with tagged prefix (ignored if no prefix character) from the extracted paragraph and adds it as a hashtag at the combined note end.",
44
"settings.refreshMetaData": "Append extracted note refresh metadata",
55
"settings.refreshMetaDataDescription": "Add extracted note settings and note list to the end of the note for refresh",
6+
"settings.richtextMetaData": "Enable rich text editor compatibility for refresh metadata",
7+
"settings.richtextMetaDataDescription": "Stop refresh metadata from being automatically deleted by the rich text editor",
68
"settings.extractAtBulletLevel": "Extract content at the bulleted list item level",
79
"settings.extractAtBulletLevelDescription": "Extracts only the bulleted line with the keyword rather than the full paragraph bulleted list.",
810
"settings.ignoreCase": "Ignore the keyword case",

src/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifest_version": 1,
33
"id": "io.github.djsudduth.paragraph-extractor",
44
"app_min_version": "1.8.1",
5-
"version": "1.2.0",
5+
"version": "1.2.1",
66
"name": "Paragraph Extractor",
77
"description": "Extract specific paragraphs out of Joplin notes using keywords, hashtags or custom tags",
88
"author": "djsudduth",

src/settings.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,15 @@ export namespace settings {
9191
description: i18n.__("settings.refreshMetaDataDescription"),
9292
},
9393

94+
richtextMetaData: {
95+
value: true,
96+
type: SettingItemType.Bool,
97+
section: "extractParagraphSection",
98+
public: true,
99+
label: i18n.__("settings.richtextMetaData"),
100+
description: i18n.__("settings.richtextMetaDataDescription"),
101+
},
102+
94103
combinedNoteTitle: {
95104
value: "default",
96105
type: SettingItemType.String,

0 commit comments

Comments
 (0)