File tree Expand file tree Collapse file tree
extensions/ql-vscode/src/view Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,12 +10,28 @@ interface Props {
1010
1111export default function RawTableValue ( props : Props ) : JSX . Element {
1212 const v = props . value ;
13+ const codes : { [ key : string ] : any } = {
14+ '\n' : 'U+000A' ,
15+ '\b' : 'U+2084' ,
16+ '\0' : 'U+0000'
17+ } ;
18+
1319 if (
1420 typeof v === 'string'
1521 || typeof v === 'number'
1622 || typeof v === 'boolean'
1723 ) {
18- return < span > { v . toString ( ) } </ span > ;
24+ const text = v . toString ( ) ;
25+ const newVal = text . split ( '' ) ;
26+ for ( let i = 0 ; i < newVal . length ; i ++ ) {
27+ for ( const char in codes ) {
28+ if ( char === newVal [ i ] ) {
29+ newVal [ i ] = codes [ char ] ;
30+ }
31+ }
32+ }
33+ const cleanVal = newVal . join ( '' ) ;
34+ return < span > { cleanVal } </ span > ;
1935 }
2036
2137 return renderLocation ( v . url , v . label , props . databaseUri ) ;
You can’t perform that action at this time.
0 commit comments