When the markdown editor replaces the ordinary visual editor, the front desk shows how to solve the problem.


For example, I now have two ideas:
First, the disadvantage of using js for foreground processing is that it is unfriendly to search engines. Personally, I feel that search engines may not have high affinity for markdown texts.
The second is to convert markdown text into html when outputting, which can achieve code consistency. The code output from the back end to the front end is html. However, there is a bug in this case. If your own framework can be greatly changed to support markdown conversion, but if plug-ins are developed for others or the development framework is ready, how to deal with the problem of large-scale conversion in view?

The first one has been implemented in the expansion of Cicada markdown editor. Recently, I have been thinking about the second one how to control the content output simply and effectively. I have encountered some problems:
1. How to Judge a String Content as markdown Text Content
2. How to batch convert markdown content without changing the view template

In view of the above, I hope to share with you the plan for markdown.
Cicada knows that the markdown editor uses editmd as markdown input and output.

Extended source code is available throughhttp://git.oschina.net/hainuo …Obtain

Individuals prefer the first option.
First of all, this is more conducive to the separation of the front and rear ends. For example, when the front end is adapted to various display styles, the back end may not change the code.
Secondly, I think even the Markdown text is very readable for the problems you mentioned about the search engine listing. Furthermore, as more and more websites are designed in asynchronous loading and single page mode, search engines have gradually improved their capture mechanism. In addition, we can directly specify key information through meta.

As for how to judge whether the string is markdown, I think this need not be judged. If it is not markdown, even if markdown is used for analysis, the output is the most basic text.
To convert the content without changing the View actually steps on the pit I mentioned above, that is, the back-end conversion is difficult to avoid the situation that the front end and the back end are not separated, and the conversion inevitably involves the problem that the conversion program and the view module code share weal and woe.