Torna ai servizi

Editor SVG online

Modifica il codice SVG nel browser con anteprima in tempo reale e download.

Il file viene elaborato localmente nel browser • nessun upload al server • scarica l’SVG finale.

Anteprima

Nessun file
Carica un SVG Dopo il caricamento, l’immagine apparirà qui e si aggiornerà modificando il codice.
Dimensione: — File: —

Codice SVG

Живое обновление
0 caratteri Le modifiche vengono applicate automaticamente

Informazioni sullo strumento — Editor SVG online

Modifica il codice SVG nel browser con anteprima in tempo reale e download.

Carica un file SVG o incolla il codice XML, cambia colori, dimensioni, testo, linee e altri parametri, controlla subito il risultato e salva l’SVG finale. Lo strumento funziona direttamente dalla pagina web di DEVNEW.ORG e non richiede software aggiuntivo. È utile per proprietari di siti, sviluppatori, specialisti SEO, designer e chiunque abbia bisogno di una rapida utility online. Può essere usato gratuitamente per attività professionali o personali.

Vedi anche

'; empty.style.display = 'none'; frame.style.display = 'block'; setStatusOk(); updateMeta(result.root, source); } function parseAndSanitize(source) { try { const parser = new DOMParser(); const doc = parser.parseFromString(source, 'image/svg+xml'); const parseError = doc.querySelector('parsererror'); if (parseError) { return { ok: false, error: 'Il codice SVG contiene un errore di sintassi.' }; } const root = doc.documentElement; if (!root || root.nodeName.toLowerCase() !== 'svg') { return { ok: false, error: 'Il codice deve contenere un elemento radice .' }; } sanitizeSvg(root); return { ok: true, root: root, svg: new XMLSerializer().serializeToString(root) }; } catch (e) { return { ok: false, error: 'Impossibile analizzare il codice SVG.' }; } } function sanitizeSvg(root) { const blockedTags = [ 'script', 'foreignObject', 'iframe', 'object', 'embed', 'audio', 'video' ]; blockedTags.forEach(function (tag) { root.querySelectorAll(tag).forEach(function (node) { node.remove(); }); }); root.querySelectorAll('*').forEach(function (node) { Array.from(node.attributes).forEach(function (attr) { const name = attr.name.toLowerCase(); const value = String(attr.value || '').trim().toLowerCase(); if (name.startsWith('on')) { node.removeAttribute(attr.name); return; } if ( (name === 'href' || name === 'xlink:href') && ( value.startsWith('javascript:') || value.startsWith('http://') || value.startsWith('https://') || value.startsWith('//') ) ) { node.removeAttribute(attr.name); } }); }); } function updateMeta(root, source) { let width = root.getAttribute('width') || ''; let height = root.getAttribute('height') || ''; const viewBox = root.getAttribute('viewBox') || ''; if ((!width || !height) && viewBox) { const values = viewBox.trim().split(/\s+/); if (values.length === 4) { if (!width) width = values[2]; if (!height) height = values[3]; } } dimensions.textContent = 'Dimensione: ' + (width && height ? width + ' × ' + height : 'non specificato'); const bytes = new Blob([source]).size; fileSize.textContent = 'Файл: ' + formatBytes(bytes); } function clearPreview() { frame.srcdoc = ''; frame.style.display = 'none'; empty.style.display = 'block'; status.className = 'svg-status'; status.innerHTML = ' Nessun file'; dimensions.textContent = 'Dimensione: —'; fileSize.textContent = 'File: —'; chars.textContent = code.value.length + ' caratteri'; hideError(); } function setStatusOk() { status.className = 'svg-status ok'; status.innerHTML = ' SVG valido'; } function setStatusError() { status.className = 'svg-status error'; status.innerHTML = ' Ошибка кода'; } function showError(message) { errorBox.textContent = message; errorBox.style.display = 'block'; } function hideError() { errorBox.textContent = ''; errorBox.style.display = 'none'; } function formatBytes(bytes) { if (bytes >= 1024 * 1024) { return (bytes / 1024 / 1024).toFixed(2) + ' MB'; } if (bytes >= 1024) { return (bytes / 1024).toFixed(2) + ' KB'; } return bytes + ' Б'; } function prettyXml(xml) { xml = xml.replace(/>\s*<'); const nodes = xml.replace(//.test(trimmed)) { pad = Math.max(0, pad - 1); } out += ' '.repeat(pad) + trimmed + '\n'; if ( /^<[^!?/][^>]*[^/]?>$/.test(trimmed) && !/^<(path|circle|rect|line|polyline|polygon|ellipse|use|image|stop|br)\b/i.test(trimmed) && !trimmed.includes('