HTML から Markdown への変換と再構築

I need your help on a problem. We have a lot of topics stored as HTML in the database (raw_data) but it’s HTML that is “migrated” from an other system. It was done before we brought the website and would’ve never ever done it this way. What we want to achieve is to convert the HTML-String containing <div>, <link>, <br />, <span>, <blockquote>,<small> but no <p> and something that is no HTML like [quote][/quote] into Markdown and than rebake the posts, to get them into discourse style HTML so that they where optimized by discourse (e. g. crawler view). At the moment the plain old HTML content is used (cooked_method=2) wich leads to many crawling issues and soft404 in Google Search Console.
We have to do this for about 4-5Mio posts, so it will be very expensive job.

Any ideas?

Best, Mike

「いいね!」 2

We have a built in HTML → Markdown convertor library, it is not perfect but it does the job for the quote function.

You could pass all the posts through that I guess, but what you are describing here, to me, sounds like a large amount of custom work. I would recommend reaching out the the community on marketplace and putting a $$$ value on the job.

「いいね!」 3

That’s the kind of thing that I do. You can email Jay@literatecomputing.com.

「いいね!」 2

実際、あなたの html2markdown パーサーは非常に気に入っており、Discourse 以外でも日常業務で活用したいと考えています。これをテキストエリアのデモとして抽出する方法について、何かヒントはありますか?

html2markdown パーサーは数多く存在します。Aaron Swartz 氏も 一つ書きました

違いは、あなたのパーサーは私が望むことを正確に実行すると信頼している点です。過不足なく。

ありがとうございます。

LQ

「いいね!」 1