If a column name contains JSON or YAML then do the appropriate parsing and pretty-printing, if parsing fails then just return the value in a pre tag and highlight using hljs
We could also add config to explicitly enable or disable this, similar to what is done with image
Sample SQL using MySQL data source
SELECT
'test: {"k2": "v2", "k3": {"k4": "v4"}}\ntest2: [1,2]' AS sample_yaml,
'{"test":{"k2":"v2","k3":{"k4":"v4"}},"test2":[1,2]}' AS sample_json,
'test_content' AS sample_text
UNION
SELECT 'invaid: yaml\nobject', '{"invalid": "json"', 'more_text'
Following on from idea: https://github.com/ankane/blazer/issues/388
If a column name contains
JSON
orYAML
then do the appropriate parsing and pretty-printing, if parsing fails then just return the value in apre
tag and highlight usinghljs
We could also add config to explicitly enable or disable this, similar to what is done with image
Sample SQL using MySQL data source