mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-28 12:11:53 +01:00
Switch to vkbeautify for XML
https://feedback.yaak.app/p/xml-pretty-formatter-not-rendering-correctly
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import vkBeautify from 'vkbeautify';
|
||||
import { invokeCmd } from './tauri';
|
||||
|
||||
export async function tryFormatJson(text: string): Promise<string> {
|
||||
@@ -23,8 +24,7 @@ export async function tryFormatXml(text: string): Promise<string> {
|
||||
if (text === '') return text;
|
||||
|
||||
try {
|
||||
const result = await invokeCmd<string>('cmd_format_xml', { text });
|
||||
return result;
|
||||
return vkBeautify.xml(text, ' ');
|
||||
} catch (err) {
|
||||
console.warn('Failed to format XML', err);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ type TauriCmd =
|
||||
| 'cmd_dismiss_notification'
|
||||
| 'cmd_export_data'
|
||||
| 'cmd_format_json'
|
||||
| 'cmd_format_xml'
|
||||
| 'cmd_get_http_authentication_config'
|
||||
| 'cmd_get_http_authentication_summaries'
|
||||
| 'cmd_get_sse_events'
|
||||
|
||||
Reference in New Issue
Block a user