You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to be able for example to display ok in green in {"status": "ok"} and error in red in {"status": "error"}.
I think we could have an optional format field in config with a callback that has value and type as arguments. The return value can alter the output (maybe adding a CSS class).
The text was updated successfully, but these errors were encountered:
ALso, the CSS for the values in the json. Currently, json-formatter-string class has a property white-space: pre which prevent wrapping the content. Can this issue be addressed?
@aj599t with the proposed API it should be possible. What I'm thinking is this:
functionformat(type: string,value: string,node: HTMLSpanElement): HTMLSpanElement{// Here you can apply styles or append classes to the element// or even inject new elements inside the spannode.classList.add('myClass');node.style.fontSize='12px'constspan=document.createElement('span');span.innerText='hi';node.appendChild(span);returnnode;}
I would like to be able for example to display
ok
in green in{"status": "ok"}
anderror
in red in{"status": "error"}
.I think we could have an optional
format
field inconfig
with a callback that hasvalue
andtype
as arguments. The return value can alter the output (maybe adding a CSS class).The text was updated successfully, but these errors were encountered: