mirror of
				https://github.com/Jermolene/TiddlyWiki5
				synced 2025-11-04 01:23:01 +00:00 
			
		
		
		
	Only turn binary tiddlers into attachments
This commit is contained in:
		@@ -107,7 +107,9 @@ SqlTiddlerStore.prototype.processIncomingTiddler = function(tiddlerFields) {
 | 
			
		||||
	if(attachmentSizeLimit < 100 * 1024) {
 | 
			
		||||
		attachmentSizeLimit = 100 * 1024;
 | 
			
		||||
	}
 | 
			
		||||
	if(tiddlerFields.text && tiddlerFields.text.length > attachmentSizeLimit) {
 | 
			
		||||
	const contentTypeInfo = $tw.config.contentTypeInfo[tiddlerFields.type || "text/vnd.tiddlywiki"],
 | 
			
		||||
		isBinary = !!contentTypeInfo && contentTypeInfo.encoding === "base64";
 | 
			
		||||
	if(isBinary && tiddlerFields.text && tiddlerFields.text.length > attachmentSizeLimit) {
 | 
			
		||||
		const attachment_blob = this.attachmentStore.saveAttachment({
 | 
			
		||||
			text: tiddlerFields.text,
 | 
			
		||||
			type: tiddlerFields.type,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user