diff --git a/src/components/dialogs/ExportProject.vue b/src/components/dialogs/ExportProject.vue index d754963..9989b6f 100644 --- a/src/components/dialogs/ExportProject.vue +++ b/src/components/dialogs/ExportProject.vue @@ -141,30 +141,6 @@ - - - - - Some projects can have overlapping names for multiple documents. -
- Normally, this would results in the contents of the documents overwriting each other. -
- If this is turned on, documents will also receive their unique IDs -
- attached to their file names - preventing any overwriting. -
-
-
- - - -
- @@ -314,10 +290,9 @@
- -
- Please condider turning the safety export mode ON before exporting to avoid data loss! +
+ Please condider turning the unique-indentifier mode ON before exporting to avoid data loss!
@@ -541,6 +516,8 @@ export default class ExportProject extends DialogBase { resetLocalData () { this.selectedExportFormat = "Adobe Reader - PDF" this.exportWholeProject = false + this.useCompatibilityMode = true + this.includeSpoilers = false this.includeTags = false this.includeHierarchyPath = false this.hideDeadInformation = false @@ -550,7 +527,6 @@ export default class ExportProject extends DialogBase { this.useFallbackFont = false this.exportDocumentsModel = [] this.exportOngoing = false - this.useSafetyMode = true this.exportList = [] } @@ -591,8 +567,6 @@ export default class ExportProject extends DialogBase { useFallbackFont = false - useSafetyMode = true - noFolderMode = false setDocumentPreviewClose () { @@ -890,7 +864,10 @@ export default class ExportProject extends DialogBase { // Build string out of lists if (field.type === "list" && Array.isArray(returnValue)) { if (!field.predefinedListExtras) { - returnValue = returnValue.map((e: {value: string}) => `${e.value}`) + returnValue = returnValue.map((e: {value: string}) => { + const returnString = e.value.replace(/(\r\n|\n|\r)/gm, "") + return returnString + }) } else { if (field.predefinedListExtras?.reverse) { @@ -899,6 +876,7 @@ export default class ExportProject extends DialogBase { if (e.value) { returnString = `${returnString}: ${e.value}` } + returnString = returnString.replace(/(\r\n|\n|\r)/gm, "") return returnString }) } @@ -908,6 +886,7 @@ export default class ExportProject extends DialogBase { if (e.affix) { returnString = `${e.value} (${e.affix})` } + returnString = returnString.replace(/(\r\n|\n|\r)/gm, "") return returnString }) } @@ -936,8 +915,7 @@ export default class ExportProject extends DialogBase { // eslint-disable-next-line @typescript-eslint/restrict-template-expressions localReturnValue = `${localReturnValue} (${matchedNote.value})` } - - returnValue = localReturnValue + returnValue = localReturnValue.replace(/(\r\n|\n|\r)/gm, "") } else { returnValue = "" @@ -970,7 +948,7 @@ export default class ExportProject extends DialogBase { // eslint-disable-next-line @typescript-eslint/restrict-template-expressions localReturnValue = `${localReturnValue} (${matchedNote.value})` } - + localReturnValue = localReturnValue.replace(/(\r\n|\n|\r)/gm, "") return localReturnValue } return " " @@ -1067,9 +1045,7 @@ export default class ExportProject extends DialogBase { } // Fix invalid characters in document file name - let exportFileName = (this.useSafetyMode && this.exportWholeProject) - ? `${input.name} (${input.id})` - : input.name + let exportFileName = input.name reservedCharacterList.forEach(char => { exportFileName = exportFileName.replace(char, "-") exportFileName = exportFileName.replace(char, "-") @@ -1340,6 +1316,11 @@ export default class ExportProject extends DialogBase { else if (!this.writerMode) { doc.font("Roboto-Bold").fillColor("#000000").fontSize(textFont) .text(field.label, textPadding, undefined, paragraphOptions) + + if (input.id === "60d23d8b-367f-4d5c-870c-74a0d46d6019") { + console.log(field.label) + console.log(field.value) + } doc.font("Roboto-Regular").fillColor("#000000").fontSize(textFont) .list((Array.isArray(field.value) ? field.value : [field.value]), listPadding, undefined, paragraphOptions) .moveDown() diff --git a/src/documents/changeLog.md b/src/documents/changeLog.md index 3812ca2..d6595ce 100644 --- a/src/documents/changeLog.md +++ b/src/documents/changeLog.md @@ -17,6 +17,7 @@ - Fixed a typo in "Save all opened documents with active changes" keybind - Fixed a bug that was causing the predefined select list sometimes completely disappear along with whole select in the single-select field when filtering (eg: Sex field) - Slightly improved performance when loading the project for the first time +- Fixed a bug in PDF export that was causing export crashes in case of line breaks present in the list/relationship field notes ### New features