I’ve got a bunch of posts with lines that start with a tab character (	
), and they look like this:
The first line of a paragraph
is shown as preformatted text.
rake posts:remap["	","\ "]
is not finding anything to remap. Is there a way to replace the tab character?
2 Likes
pfaffman
(Jay Pfaffman)
2
Try
rake posts:remap["\t","\ "]
Are you sure, Jay?
Are you sure you want to replace all string occurrences of 't' with ' '? (Y/n)
I migh end up wi h a lo of missing ee h!
1 Like
pfaffman
(Jay Pfaffman)
4
No. I’m not sure. But if that’s the message you got, you might try
rake posts:remap["\\t","\ "]
I get an identical confirmation message as with a single backslash.
1 Like
pfaffman
(Jay Pfaffman)
6
Hmm. Maybe
rake posts:remap['\t',"\ "]
Perhaps the task needs to be told explicitly to use regex with a type argument?
https://github.com/discourse/discourse/blob/master/lib/tasks/posts.rake#L154-L155
Edit:
rake posts:remap["\t","\ ",regex]
Are you sure you want to replace all regex occurrences of 't' with ' '? (Y/n)
But, I am still not sure if this would remove all t characters.