Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit 46adc65

Browse files
Merge pull request #468 from deckgo/publish-clean-notes
feat: clean notes on publish
2 parents 8ea12ac + a1fbbeb commit 46adc65

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

studio/src/app/services/editor/publish/publish.service.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ export class PublishService {
208208
};
209209

210210
const cleanApiSlide: ApiSlide = await this.convertSlideQRCode(apiSlide);
211+
cleanApiSlide.content = await this.cleanNotes(apiSlide.content);
211212

212213
resolve(cleanApiSlide);
213214
});
@@ -235,6 +236,19 @@ export class PublishService {
235236
});
236237
}
237238

239+
private cleanNotes(content: string): Promise<string> {
240+
return new Promise<string>((resolve) => {
241+
if (!content || content === undefined || content === '') {
242+
resolve(content);
243+
return;
244+
}
245+
246+
let result: string = content.replace(/<div slot="notes">(.*?)<\/div>/gis, '');
247+
248+
resolve(result);
249+
});
250+
}
251+
238252
private convertSlideQRCode(apiSlide: ApiSlide): Promise<ApiSlide> {
239253
return new Promise<ApiSlide>(async (resolve) => {
240254
if (!apiSlide) {

0 commit comments

Comments
 (0)