I have noticed that string formatting is stripped away in Looker. Example, if I have a string Dimension and the underlying data contains tabs or line feeds, this formatting is removed in the resulting Looker query.
Are there any ways to change that behavior?
Solved! Go to Solution.
I think the effect you’re referring to is actually the result of the browser’s default behavior for text content. The data should still contain that whitespace if you download it as a csv, for example.
If you add an html declaration to your dimension, you can be more explicit about how it is displayed in the browser, including by using a `<pre>` tag or using a `style=”white-space:...”` attribute
So approximately this:
dimension: foo {
...
html:<div style="white-space:pre">{{value}}</div>;;
}
I think the effect you’re referring to is actually the result of the browser’s default behavior for text content. The data should still contain that whitespace if you download it as a csv, for example.
If you add an html declaration to your dimension, you can be more explicit about how it is displayed in the browser, including by using a `<pre>` tag or using a `style=”white-space:...”` attribute
So approximately this:
dimension: foo {
...
html:<div style="white-space:pre">{{value}}</div>;;
}