mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-05 05:30:02 +00:00
ecabcd676b
Which means adding a parser for SVG, even though it doesn't actually do any parsing at the moment
35 lines
578 B
JavaScript
35 lines
578 B
JavaScript
/*\
|
|
title: js/SVGParser.js
|
|
|
|
Compiles SVG images into JavaScript functions that render them in HTML
|
|
|
|
\*/
|
|
(function(){
|
|
|
|
/*jslint node: true */
|
|
"use strict";
|
|
|
|
// The parse tree is degenerate
|
|
var SVGParseTree = function() {
|
|
this.dependencies = [];
|
|
};
|
|
|
|
SVGParseTree.prototype.compile = function(type) {
|
|
if(type === "text/html") {
|
|
return "(function (tiddler,store,utils) {return tiddler.fields.text;})";
|
|
} else {
|
|
return null;
|
|
}
|
|
};
|
|
|
|
var SVGParser = function() {
|
|
};
|
|
|
|
SVGParser.prototype.parse = function() {
|
|
return new SVGParseTree();
|
|
};
|
|
|
|
exports.SVGParser = SVGParser;
|
|
|
|
})();
|