Javascript-markdown Parsing

Source: Internet
Author: User
It seems that this question can also be called. I have used some reliable markdown libraries, common js and php libraries, but one problem is that the frontend and backend results are inconsistent. It seems that SF also has this problem. The frontend uses js rendering and the backend uses php. There are some slight differences between them. I know that node is used. j... it seems that this question can also be called. I have used some reliable markdown libraries, common js and php libraries, but one problem is that the frontend and backend results are inconsistent.

It seems that SF also has this problem. The frontend uses js rendering and the backend uses php. There are some slight differences between them. I know that node is used. javascript can be used both in front and back, but the problem is that I cannot change the backend language at will. Is there a good solution?

Reply content:

It seems that this question can also be called. I have used some reliable markdown libraries, common js and php libraries, but one problem is that the frontend and backend results are inconsistent.

It seems that SF also has this problem. The frontend uses js rendering and the backend uses php. There are some slight differences between them. I know that node is used. javascript can be used both in front and back, but the problem is that I cannot change the backend language at will. Is there a good solution?

You can build a Markdown Resolution Service (Node. js) API in the external environment. You just need to unify the parsing. In this way, you do not need to switch the language to achieve the effect.

Php and js proxies can interact with each other. There is an example called phpjs, which provides a lot of php base letter JavaScript implementations.

The rest is just a matter of refreshing the limit method. Simply put: port the back-end algorithm to the front-end. (The opposite is true ...)

In the past, we often encountered this problem. We have made many manual operations, but it can actually be done by a program. The js and php NLP methods are really very similar. To be honest, it is quite easy to start using them.

Not much said, someone has done: https://code.google.com/p/php-to-js/

There is also this: https://github.com/Danack/PHP-to-Javascript

If you cannot change the backend language randomly, the simplest way is to use your backend language to call Node through a process call to process the file and then read the result back.

Of course, there are some more troublesome methods ...... After the frontend and backend algorithms are unified, they are precisely implemented at the front and backend ......

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.