Hide specific element attribute from editor view

Having trouble installing Oxygen? Got a bug to report? Post it all here.
vitorhugovm
Posts: 11
Joined: Fri Jan 26, 2024 3:31 pm

Hide specific element attribute from editor view

Post by vitorhugovm »

I'm currently using content: oxy_name() oxy_attributes() in CSS to personalize the elements render in the XML Editor, but all attributes are shown, including the id, which is really polluting the editor view.
I didn't find any parameters that could be applied to oxy_attributes() in the documentation. I wanted to omit the id and possibly other element attributes in the future, is there a way of doing that?
Thanks!
Vitor
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Hide specific element attribute from editor view

Post by Radu »

Hi Vitor,
How about if you use our oxy_replace over the value returned by oxy_attributes to apply a regexp which removes part of the displayed attributes string?
https://www.oxygenxml.com/doc/ug-editor ... ction.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
vitorhugovm
Posts: 11
Joined: Fri Jan 26, 2024 3:31 pm

Re: Hide specific element attribute from editor view

Post by vitorhugovm »

For sure the best and most efficient way of doing it, worked perfectly!
If anyone wonders anytime, I used oxy_replace(oxy_attributes(), ' id="[^"]*"', '', true) to make it work.
Thank you very much Radu!
Vitor
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Hide specific element attribute from editor view

Post by Radu »

Hi Vitor,
Great, also thanks for posting the end solution!
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply