For example, I have two ideas: first, the disadvantage of using js for front-end processing is that it is unfriendly to search engines. I personally feel that the search engine may not be highly compatible with markdown text. Second, convert markdown text to html during output so that code consistency can be achieved. for example, I have two ideas:
First, the disadvantage of using js for front-end processing is that it is unfriendly to search engines. I personally feel that the search engine may not be highly compatible with markdown text.
Second, the markdown text is converted to html during output, so that code consistency can be achieved. the code output from the backend to the front-end is html, however, this kind of bug can be greatly changed by the framework itself to support markdown conversion. However, if plug-ins are developed for others or the development framework is ready, it is difficult to convert a large area in a view. how can this problem be solved.
The first one has been implemented in the markdown editor extension. recently I have been thinking about how to control content output in a simple and effective manner. I have encountered the following problems:
1. how to determine whether the content of a string is markdown text content
2. how to bulk convert markdown content without changing the view template
In view of the above, I hope to share with you the markdown presentation solution.
Ps:
The editor uses editmd as the markdown input and output.
Extended source code can be obtained through http://git.oschina.net/hainuo...
Reply content:
For example, I have two ideas:
First, the disadvantage of using js for front-end processing is that it is unfriendly to search engines. I personally feel that the search engine may not be highly compatible with markdown text.
Second, the markdown text is converted to html during output, so that code consistency can be achieved. the code output from the backend to the front-end is html, however, this kind of bug can be greatly changed by the framework itself to support markdown conversion. However, if plug-ins are developed for others or the development framework is ready, it is difficult to convert a large area in a view. how can this problem be solved.
The first one has been implemented in the markdown editor extension. recently I have been thinking about how to control content output in a simple and effective manner. I have encountered the following problems:
1. how to determine whether the content of a string is markdown text content
2. how to bulk convert markdown content without changing the view template
In view of the above, I hope to share with you the markdown presentation solution.
Ps:
The editor uses editmd as the markdown input and output.
Extended source code can be obtained through http://git.oschina.net/hainuo...
Individuals prefer the first solution.
First, this is more conducive to frontend and backend separation. For example, when the front-end is compatible with multiple display styles, the back-end may not change the code.
Secondly, for the search engine indexing problem you mentioned, I think even the Markdown text is quite readable. Furthermore, as more and more websites adopt asynchronous loading and single-page mode, search engines are gradually improving their crawling mechanism. In addition, key information can be directly specified through meta.
I don't need to judge whether the string is markdown. If it is not markdown, even if markdown is used for parsing, the output is the most basic text.
Without changing the View, the content is converted. In fact, I step on the pitfalls mentioned above, that is, back-end conversion is difficult to avoid the absence of front-end and back-end separation, conversion involves the coexistence of the conversion program and view module code.