fix: handle flash players

This commit is contained in:
2026-02-15 19:52:44 +01:00
parent 94695b5aef
commit 56e5987341
3 changed files with 33 additions and 1 deletions

View File

@@ -264,6 +264,21 @@ export class ImportAnalysisEngine {
return `![${altText}](${imageUrl})`;
},
});
// Custom rule for Flash embeds - replace with placeholder text
this.turndown.addRule('flashEmbed', {
filter: (node) => {
if (node.nodeName !== 'EMBED') return false;
const embed = node as HTMLEmbedElement;
const type = embed.getAttribute('type') || '';
const src = embed.getAttribute('src') || '';
// Match Flash content by type or file extension
return type.toLowerCase().includes('flash') ||
type.toLowerCase().includes('shockwave') ||
src.toLowerCase().endsWith('.swf');
},
replacement: () => 'FLASH PLAYER NOT SUPPORTED',
});
// Load macro definitions from shared config
this.loadMacroConfigsFromShared();

View File

@@ -178,6 +178,21 @@ export class ImportExecutionEngine extends EventEmitter {
return `![${altText}](${imageUrl})`;
},
});
// Custom rule for Flash embeds - replace with placeholder text
this.turndown.addRule('flashEmbed', {
filter: (node) => {
if (node.nodeName !== 'EMBED') return false;
const embed = node as HTMLEmbedElement;
const type = embed.getAttribute('type') || '';
const src = embed.getAttribute('src') || '';
// Match Flash content by type or file extension
return type.toLowerCase().includes('flash') ||
type.toLowerCase().includes('shockwave') ||
src.toLowerCase().endsWith('.swf');
},
replacement: () => 'FLASH PLAYER NOT SUPPORTED',
});
}
setProjectContext(projectId: string, dataDir?: string): void {