mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-01-02 22:32:27 +08:00
fix: decode URL-encoded content in extractDiagramXML function
This commit is contained in:
@@ -60,7 +60,10 @@ export function extractDiagramXML(xml_svg_string: string): string {
|
|||||||
const decoder = new TextDecoder('utf-8');
|
const decoder = new TextDecoder('utf-8');
|
||||||
const decodedString = decoder.decode(decompressedData);
|
const decodedString = decoder.decode(decompressedData);
|
||||||
|
|
||||||
return decodedString;
|
// Decode URL-encoded content (equivalent to Python's urllib.parse.unquote)
|
||||||
|
const urlDecodedString = decodeURIComponent(decodedString);
|
||||||
|
|
||||||
|
return urlDecodedString;
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error extracting diagram XML:", error);
|
console.error("Error extracting diagram XML:", error);
|
||||||
|
|||||||
Reference in New Issue
Block a user