Ready to convert the original article content into markdown format, is there any good ideas or tools?

Source: Internet
Author: User
The original database is saved in HTML format article, how to convert to markdown format, and then save it back?

Found a few HTML to Markdown PHP class performance is not good, there are many can not parse, such as the Alt/title location change will not convert.

JS is better than PHP, but JS must be read to the browser, and then the browser to submit to the database. If it is JS, the idea is this:

    1. After reading to the JS variable, then JS variable output to $container.html (JS variable)

    2. Re-read $container.text () in the commit to database

To do so, the main consideration is that some can not be transferred// are filtered

Is there a simpler, or better tool?

Reply content:

The original database is saved in HTML format article, how to convert to markdown format, and then save it back?

Found a few HTML to Markdown PHP class performance is not good, there are many can not parse, such as the Alt/title location change will not convert.

JS is better than PHP, but JS must be read to the browser, and then the browser to submit to the database. If it is JS, the idea is this:

    1. After reading to the JS variable, then JS variable output to $container.html (JS variable)

    2. Re-read $container.text () in the commit to database

To do so, the main consideration is that some can not be transferred// are filtered

Is there a simpler, or better tool?

https://domchristie.github.io/to-markdown/

Markdown originally can be used in HTML code (of course, the specific look at the parser, some do not support), so the conversion does not affect the resolution.

If you have obsessive-compulsive disorder, then let me not say.

Markdown rules are simple, you can write a program.

  • 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.