vendor/emmet.js
function decodeFromBase64(editor, data, pos) {
		// ask user to enter path to file
		var filePath = String(editor.prompt('Enter path to file (absolute or relative)'));
		if (!filePath)
			return false;
			
		var file = require('file');
		var absPath = file.createPath(editor.getFilePath(), filePath);
		if (!absPath) {
			throw "Can't save file";
		}
		
		file.save(absPath, require('base64').decode( data.replace(/^data\:.+?;.+?,/, '') ));
		editor.replaceContent('$0' + filePath, pos, pos + data.length);
		return true;
	}
function decodeFromBase64(editor, data, pos) {
		// ask user to enter path to file
		var filePath = String(editor.prompt('Enter path to file (absolute or relative)'));
		if (!filePath)
			return false;
			
		var file = require('file');
		var absPath = file.createPath(editor.getFilePath(), filePath);
		if (!absPath) {
			throw "Can't save file";
		}
		
		file.save(absPath, require('base64').decode( data.replace(/^data\:.+?;.+?,/, '') ));
		editor.replaceContent('$0' + filePath, pos, pos + data.length);
		return true;
	}
function decodeFromBase64 ( editor , data , pos ) { // ask user to enter path to file var filePath = String ( editor . prompt ( 'Enter path to file (absolute or relative)' ) ) ; if ( ! filePath ) return false ; var file = require ( 'file' ) ; var absPath = file . createPath ( editor . getFilePath ( ) , filePath ) ; if ( ! absPath ) { throw "Can't save file" ; } file . save ( absPath , require ( 'base64' ) . decode ( data . replace ( / ^data\:.+?;.+?, / , '' ) ) ) ; editor . replaceContent ( '$0' + filePath , pos , pos + data . length ) ; return true ; }
Decodes base64 string back to file.
@param {IEmmetEditor} editor
@param {String} data Base64-encoded file content
@param {Number} pos Caret position where image is located in the editor
Decodes base64 string back to file .