Skip to content

Commit

Permalink
Update datauri
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbvz committed Sep 8, 2021
1 parent 9501fbe commit a376573
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@
"webpack-cli": "^4.8.0"
},
"dependencies": {
"datauri": "^3.0.0",
"datauri": "^4.1.0",
"gemoji": "^5.0.1"
}
}
7 changes: 3 additions & 4 deletions src/DecoratorProvider.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import * as vscode from "vscode";
import { Configuration } from './configuration';
import { Emoji, EmojiProvider } from './emoji';
import DataURIParser from 'datauri/parser';

// eslint-disable-next-line @typescript-eslint/no-var-requires
const DatauriParser = require('datauri/parser');
const parser = new DatauriParser();
const parser = new DataURIParser();

export default class DecoratorProvider extends vscode.Disposable {

Expand Down Expand Up @@ -97,7 +96,7 @@ export default class DecoratorProvider extends vscode.Disposable {
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="${width}px" height="${height}px" viewBox="0 0 ${width} ${height}" xml:space="preserve">
<text x="50%" y="50%" text-anchor="middle" alignment-baseline="central" font-size="120">${emoji.emoji}</text>
</svg>`;
const content = parser.format('.svg', src);
const { content } = parser.format('.svg', src);
return `![](${content})`;
}
}
8 changes: 5 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"moduleResolution": "node",
"target": "es2018",
"outDir": "out",
"lib": [
"es6"
"es2018"
],
"sourceMap": true,
"rootDir": "src",
"strict": true,
"noUnusedParameters": true
"noUnusedParameters": true,
"esModuleInterop": true
},
"exclude": [
"node_modules",
Expand Down

0 comments on commit a376573

Please sign in to comment.