mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-07 16:00:28 +00:00
Only turn binary tiddlers into attachments
This commit is contained in:
parent
a2012dcff8
commit
e66b67dedc
@ -107,7 +107,9 @@ SqlTiddlerStore.prototype.processIncomingTiddler = function(tiddlerFields) {
|
|||||||
if(attachmentSizeLimit < 100 * 1024) {
|
if(attachmentSizeLimit < 100 * 1024) {
|
||||||
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({
|
const attachment_blob = this.attachmentStore.saveAttachment({
|
||||||
text: tiddlerFields.text,
|
text: tiddlerFields.text,
|
||||||
type: tiddlerFields.type,
|
type: tiddlerFields.type,
|
||||||
|
Loading…
Reference in New Issue
Block a user