-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An option to stop recognizing code by indentations? #167
Comments
@jiyinyiyong Robotskirt is suggested, which is a sundown binding in Node. |
@lepture Did Robotskirt considered this problem and added feature for it? |
@jiyinyiyong Github is powered by sundown. And it has a renderer feature. I am introducing renderer to marked at #129 |
Judging from the API |
We are using Marked in a forum: https://github.com/cnodejs/nodeclub/
This might be a strange feature request, but let me explain:
Many programmers in China are not enough familiar with Markdown (many are famliar though). In some topics and posts, code and logs are just pasted like plain text. Code without right formating looks really bad, we were trying to find solution to fix it.
Thinking it is indeed a better experience to paste code directly in a textarea, I sent a PR to display the code in a CSS style
white-space: pre-wrap
to make writespaces visible, It makes sense that many code that was not markuped look better now with indentation and fixed-with font face.But there are still problems, for example, for code like this:
This might be a piece of code that was directly pasted into the content. Since empty lines are present, the line in the middle is recognized as code, and is transformed into a
<pre>
block. As a result, the code looks strange.code
code
If it is not regarded as code, then it could be plain text, with indentations.
With
whitespace: pre-wrap
it looks like code (without syntax highlight).Making Markdown compatible with plain text help people keep focusing on the content rather than the formating.
Meanwhile, as a personal experience, I usually edit my code in a text editor, then copy and paste it to an textarea. Adding indentations is a disguasting step, especially for a forum (much better when using Markdown for blogging).
So I think it is a trick or solution we may rely on to make Markdown better.
The text was updated successfully, but these errors were encountered: