Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lite",
"version": "4.0.4",
"version": "4.0.41",
"description": "A cross platform template engine base on xml/html and javascript expression.",
"keywords": [ "javascript","xhtml","html","Java","PHP","template"],
"author": "jindw <jindw@xidea.org> (http://www.xidea.org)",
Expand Down
6 changes: 5 additions & 1 deletion src/main/js/parse/parse-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
var ResultContext=require('./result-context').ResultContext;
var URI=require('./resource').URI;
var defaultBase = new URI("lite:///");

var os = require('os');

var loadLiteXML=require('./xml').loadLiteXML;
var buildTopChain=require('./parse-chain').buildTopChain;
Expand Down Expand Up @@ -141,6 +141,10 @@ ParseContext.prototype = {
if(path.indexOf(base) ==0){
path = path.substring(base.length-1);
}
//resolve path when url scheme is file and win32
if(cu.scheme=='file' && os.platform()=='win32'){
path = this.config.root.resolve(path.replace(/^\//,'./'))+'';
}
var cu = this.currentURI;
if(cu){
//if(cu.scheme == 'data'){
Expand Down
4 changes: 3 additions & 1 deletion src/main/js/parse/xml.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
const os = require('os');
function loadLiteXML(uri,root,options){
try{
if(uri instanceof URI){
if(uri.source){
return parseXMLByText(uri.source.replace(/^[\s\ufeff]*/,uri,options))
}else if(uri.scheme == 'lite'){
//resolve path when url scheme is file and win32
}else if(uri.scheme == 'lite' || (uri.scheme=='file' && os.platform()=='win32')){
var path = uri.path+(uri.query||'')+(uri.fragment || '');
path = root.resolve(path.replace(/^\//,'./'))+'';
}else{
Expand Down