I am in the process of developing an internal tool that allows a designer to input exported svg code into a text area and have the html code displayed in a syntax highlighter ()
When they paste their code like this
<svg xmlns="http://www.w3.org/2000/svg" width="18.135" height="12.365" viewBox="0 0 18.135 12.365">
<path id="Path_4" data-name="Path 4" d="M10.067,5.649a8.054,8.054,0,0,1,7.27,4.534,8.1,8.1,0,0,1-14.541,0,8.054,8.054,0,0,1,7.27-4.534m0-1.649A9.749,9.749,0,0,0,1,10.182a9.741,9.741,0,0,0,18.135,0A9.749,9.749,0,0,0,10.067,4Zm0,4.122a2.061,2.061,0,1,1-2.061,2.061,2.062,2.062,0,0,1,2.061-2.061m0-1.649a3.709,3.709,0,1,0,3.709,3.709A3.715,3.715,0,0,0,10.067,6.473Z" transform="translate(-1 -4)"/>
</svg>
I aim to eliminate the widths, heights, and any id attributes linked with the pasted string similar to this
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18.135 12.365">
<path d="M10.067,5.649a8.054,8.054,0,0,1,7.27,4.534,8.1,8.1,0,0,1-14.541,0,8.054,8.054,0,0,1,7.27-4.534m0-1.649A9.749,9.749,0,0,0,1,10.182a9.741,9.741,0,0,0,18.135,0A9.749,9.749,0,0,0,10.067,4Zm0,4.122a2.061,2.061,0,1,1-2.061,2.061,2.062,2.062,0,0,1,2.061-2.061m0-1.649a3.709,3.709,0,1,0,3.709,3.709A3.715,3.715,0,0,0,10.067,6.473Z" transform="translate(-1 -4)"/>
</svg>
To achieve this, I am utilizing Vuejs and would prefer using JS or jQuery to tackle this challenge. Despite attempting various methods with JS, I have not been successful in removing these attributes.