SVG as data URI triggers XML parsing error in Firefox
It is not valid for data URIs to contain # characters like yours has, you must escape them as %23
The unescaped # character is reserved to indicate the start of a fragment identifier. Firefox is quite right to indicate a parsing error.
you can use the online tool https://www.zhangxinxu.com/sp/svgo/
it support let special characters encoded, such as:
""
=> %22
#
=> %23
%
=> %25
...