About the Markdown editor when replacing a normal visual editor, the foreground shows you how to solve the problem

Source: Internet
Author: User
Title I now have two ways of thinking:
First, the use of JS for the foreground processing disadvantage is the search engine unfriendly, personal feeling search engine may be markdown text affinity is not high.
The second, in the output of the markdown text conversion to HTML, so that the code can be consistent, back-end output to the front-end of the code is HTML, but this has a bug if its own framework can be changed to make IT support markdown conversion, but if you develop plug-ins for others, Or the development framework has been done, in the view of large-area conversion some difficult, how to deal with.

The first kind I have realized in the Markdown Editor extension, and I've been thinking about the second how to control content output in a simple and effective way, and I'm having problems:
1. How to judge a string content as markdown text content
2. How to convert markdown content in bulk without changing the view template

In view of the above, I hope to communicate with you about the markdown display of the program.
Ps:
The Cicada markdown Editor uses EDITMD as the markdown input and output.

Extended source code can be passed Http://git.oschina.net/hainuo ... Get

Reply content:

Title I now have two ways of thinking:
First, the use of JS for the foreground processing disadvantage is the search engine unfriendly, personal feeling search engine may be markdown text affinity is not high.
The second, in the output of the markdown text conversion to HTML, so that the code can be consistent, back-end output to the front-end of the code is HTML, but this has a bug if its own framework can be changed to make IT support markdown conversion, but if you develop plug-ins for others, Or the development framework has been done, in the view of large-area conversion some difficult, how to deal with.

The first kind I have realized in the Markdown Editor extension, and I've been thinking about the second how to control content output in a simple and effective way, and I'm having problems:
1. How to judge a string content as markdown text content
2. How to convert markdown content in bulk without changing the view template

In view of the above, I hope to communicate with you about the markdown display of the program.
Ps:
The Cicada markdown Editor uses EDITMD as the markdown input and output.

Extended source code can be passed Http://git.oschina.net/hainuo ... Get

Individuals are more inclined to the first option.
First of all, this is more advantageous to the front and back separation. For example, when the front end is adaptable to a variety of presentation styles, the backend can not change the code.
Secondly, for you said search engine included problem, I think is markdown text, its readability is also very good. Moreover, as more and more websites are designed by asynchronous loading and single-page mode, search engines have gradually improved their crawling mechanism. In addition, we can also use meta-method to directly specify key information.

I don't think it's OK to judge whether a string is markdown. If it is not markdown, even using markdown to parse, the output is the most basic text.
Without changing the view of the content of the conversion, in fact, stepping on the pit I mentioned above, that is, the back-end conversion is difficult to avoid the front and rear end of the situation, to convert the conversion program and the View module code is necessarily related to the problem of solidarity.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.