Skip to content

Commit 3fa7b77

Browse files
author
jumptuner
committed
update test and add drop to odp
1 parent 57377dc commit 3fa7b77

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

al_test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const renderConfigs = [
5555
outputName: "resultPresentationFromODP.pdf",
5656
},
5757
{
58-
enabled: false,
58+
enabled: true,
5959
templatePath: "../freshtracksback_s4/templates/FreshtracksPresentation.odp",
6060
options: {
6161
convertTo: "pptx",

lib/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,16 @@ carbone.addFormatters(require("../formatters/condition.js"));
516516
carbone.addFormatters(require("../formatters/date.js"));
517517
carbone.addFormatters(require("../formatters/number.js"));
518518
carbone.addFormatters(require("../formatters/string.js"));
519+
carbone.addFormatters({
520+
drop: function (data, args) {
521+
// Check if the first argument is 'slide' and if the data is empty
522+
if (args[0] === "slide" && (!data || data.trim() === "")) {
523+
// Set a flag in the context to indicate that the slide should be dropped
524+
this.isHidden = true;
525+
}
526+
return data; // Return the data unchanged
527+
},
528+
});
519529
translator.loadTranslations(params.templatePath);
520530

521531
// We must include all locales like this for PKG

0 commit comments

Comments
 (0)