mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-20 08:44:52 +00:00
408fcd8aa3
It's a bit of a hack to have a parser dedicated to fonts. We'll replace it with a mechanism that handles generic binary data
29 lines
486 B
JavaScript
29 lines
486 B
JavaScript
/*\
|
|
title: $:/core/modules/parsers/fontparser.js
|
|
type: application/javascript
|
|
module-type: parser
|
|
|
|
The font parser parses fonts into URI encoded base64
|
|
|
|
\*/
|
|
(function(){
|
|
|
|
/*jslint node: true, browser: true */
|
|
/*global $tw: false */
|
|
"use strict";
|
|
|
|
var FontParser = function(type,text,options) {
|
|
this.tree = [{
|
|
type: "element",
|
|
tag: "span",
|
|
children: [
|
|
{type: "text", text: "data:" + type + ";base64," + text}
|
|
]
|
|
}];
|
|
};
|
|
|
|
exports["application/font-woff"] = FontParser;
|
|
|
|
})();
|
|
|