Commit 3981e134 authored by Akikonata's avatar Akikonata

Merge branch 'dev' of https://github.com/fex-team/kityminder into dev

parents 4221a600 3cd04eb6
...@@ -179,7 +179,7 @@ $( function () { ...@@ -179,7 +179,7 @@ $( function () {
// 检查 URL 是否分享连接,是则加载分享内容 // 检查 URL 是否分享连接,是则加载分享内容
function loadShare() { function loadShare() {
var pattern = /shareId=(\w+)([&#]|$)/; var pattern = /(?:shareId|share_id)=(\w+)([&#]|$)/;
var match = pattern.exec( window.location ) || pattern.exec( document.referrer ); var match = pattern.exec( window.location ) || pattern.exec( document.referrer );
if ( !match ) return; if ( !match ) return;
......
...@@ -31,11 +31,9 @@ KityMinder.registerProtocal( "png", function () { ...@@ -31,11 +31,9 @@ KityMinder.registerProtocal( "png", function () {
renderContainer.translate( -renderBox.x, -renderBox.y ); renderContainer.translate( -renderBox.x, -renderBox.y );
svgXml = km.getPaper().container.innerHTML; svgXml = km.getPaper().container.innerHTML;
// svg 含有   符号导出报错 Entity 'nbsp' not defined
svgXml = svgXml.replace(/ /g, ' ').replace(/\s+/g, ' ');
renderContainer.translate( renderBox.x, renderBox.y ); renderContainer.translate( renderBox.x, renderBox.y );
$svg = $( svgXml ); $svg = $( svgXml );
$svg.attr( { $svg.attr( {
width: renderBox.width, width: renderBox.width,
...@@ -46,6 +44,9 @@ KityMinder.registerProtocal( "png", function () { ...@@ -46,6 +44,9 @@ KityMinder.registerProtocal( "png", function () {
// need a xml with width and height // need a xml with width and height
svgXml = $( '<div></div' ).append( $svg ).html(); svgXml = $( '<div></div' ).append( $svg ).html();
// svg 含有 &nbsp; 符号导出报错 Entity 'nbsp' not defined
svgXml = svgXml.replace(/&nbsp;/g, '&#xa0;');
blob = new Blob( [ svgXml ], { blob = new Blob( [ svgXml ], {
type: "image/svg+xml;charset=utf-8" type: "image/svg+xml;charset=utf-8"
} ); } );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment