fix: illege mdx dictionary ,css file embed font with a lead dot,such as "./font.woff"

the leading dot character will cause the file can not be found.
This commit is contained in:
yifang 2022-01-19 21:01:35 +08:00
parent cf10810fe2
commit a37a24671c

3
mdx.cc
View file

@ -827,6 +827,9 @@ void MddResourceRequest::run()
// Convert to the Windows separator // Convert to the Windows separator
std::replace( resourceName.begin(), resourceName.end(), '/', '\\' ); std::replace( resourceName.begin(), resourceName.end(), '/', '\\' );
if(resourceName[0]=='.'){
resourceName.erase(0,1);
}
if ( resourceName[ 0 ] != '\\' ) if ( resourceName[ 0 ] != '\\' )
{ {
resourceName.insert( 0, 1, '\\' ); resourceName.insert( 0, 1, '\\' );