mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-03-04 14:59:50 +00:00
* 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
29 lines
605 B
JavaScript
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;
|