1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2026-03-04 14:59:50 +00:00
Files
TiddlyWiki5/core/modules/parsers/pdfparser.js
Saq Imtiaz 785086e0a5 Fixes ESLint errors (#9668)
* fix: apply automatic eslint fixes

* lint: allow hashbang comment for tiddlywiki.js

* lint: first back of manual lint fixes for unused vars

* lint: added more fixes for unused vars

* lint: missed files

* lint: updated eslint config with selected rules from #9669
2026-02-20 08:38:42 +00:00

29 lines
605 B
JavaScript

/*\
title: $:/core/modules/parsers/pdfparser.js
type: application/javascript
module-type: parser
The PDF parser embeds a PDF viewer
\*/
"use strict";
var ImageParser = function(type,text,options) {
var element = {
type: "element",
tag: "iframe",
attributes: {}
};
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;