Data Explorer: \n is replaced with space in RAW post field output

When fetching raw post using rails c the result includes newlines (as it should):

Post.where('topic_id = 123').last.raw
"### Title\nParagraph 1\n\nParagraph 2\n\nParagraph 3",

but when using Data Explorer query all consecutive newlines are replaced with a single space (and the result is not equal to the raw post):

SELECT raw FROM posts p WHERE p.topic_id = 123 ORDER BY p.id DESC LIMIT 1
### Title Paragraph 1 Paragraph 2 Paragraph 3

Shouldn’t the raw post field include newlines, or is this a limitation of Data Explorer?

I’d really like to get the full raw post from Data Explorer query.

Are you retrieving the query as csv (I think that can’t work) or json (which can support having me lines

And unless you are trying to get a bunch of topics at once, you might just use direct api queries, though paging can make that complicated.

1 Like

Via API.

Yes, that’s what the query is for. But since the query itself will be consumed via API, which I believe serves the results in json format, this should do.

It turns out that the query output is normalized for easy screen reading in Data Explorer web console only (both json and csv exports retain newlines), so this turns out to be a non-issue after all.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.