1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2026-03-27 01:59:50 +00:00
Files
TiddlyWiki5/core/modules/parsers/pdfparser.js
Jeremy Ruston d8b0e041b6 Initial commit
2026-02-19 12:45:27 +00:00

27 lines
579 B
JavaScript

/*\
title: $:/core/modules/parsers/pdfparser.js
type: application/javascript
module-type: parser
\*/
"use strict";
var ImageParser = function(type,text,options) {
var element = {
type: "element",
tag: "iframe",
attributes: {}
},
src;
if(options._canonical_uri) {
element.attributes.src = {type: "string", value: options._canonical_uri};
} else if(text) {
element.attributes.src = {type: "string", value: "data:application/pdf;base64," + text};
}
this.tree = [element];
this.source = text;
this.type = type;
};
exports["application/pdf"] = ImageParser;