Ok, I’m old. I’m also a publisher of books (on paper and electronic). Books indent new paragraphs. In letters or emails that use this convention, a tab is used. I’ve looked through the posts on this topic and haven’t found if there is a way to allow tabs as a default. (Or at least allow 4 or 5 spaces to function as an indent.)
Is this possible without complicated programmin or plugins?
I just submitted a pull request to introduce a new site setting strip incoming email lines . I did not want to completely disable code blocks when this setting is enabled, so code blocks will still be accepted between [code]…[/code] and ```…```, but all the other lines will be stripped (leading and trailing whitespaces will be removed).
For example, the following email:
MIME-Version: 1.0
Date: Tue, 01 Jan 2019 00:00:00 +0300
Subject: An email with whitespaces
From: Foo <foo@discourse.org>
To: bar@discourse.org
Content-Type: text/plain; charset="UTF-8"
Hello
This is a line that will be stripped
This is another line that will be stripped
This is a line that will not be touched.
This is another line that will not be touched.
[code]
1.upto(10).each do |i|
puts i
end
[/code]
This is going to be stripped too.
Bye!
will produce the following reply:
Hello
This is a line that will be stripped
This is another line that will be stripped
This is a line that will not be touched.
This is another line that will not be touched.
1.upto(10).each do |i|
puts i
end
This is going to be stripped too.
Bye!
disabling this setting will create the following reply:
Hello
This is a line that will be stripped
This is another line that will be stripped
This is a line that will not be touched.
This is another line that will not be touched.
Cool so the upshot of this setting is that traditional space indented commonmark code blocks become impossible, right? No other side effects? That seems like a reasonable tradeoff for sites that have the “random space indenting problem”
Of course, that would be ideal, but it is a lot more effort than you would think.
Our “post cooking” (converting raw text to HTML) pipeline is quite complex and in the end it gets to MarkdownIt, which does not offer something such as a reverse mapping.