{"id":86428,"date":"2025-04-28T22:51:00","date_gmt":"2025-04-28T15:51:00","guid":{"rendered":"https:\/\/itviec1.uptech.vn\/?p=86428"},"modified":"2025-04-28T22:51:00","modified_gmt":"2025-04-28T15:51:00","slug":"markdown-la-gi","status":"publish","type":"post","link":"https:\/\/itviec.com\/blog\/markdown-la-gi\/","title":{"rendered":"Markdown l\u00e0 g\u00ec: Chi ti\u1ebft c\u00e1ch chuy\u1ec3n \u0111\u1ed5i HTML sang Markdown"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">N\u1ed9i dung b\u00e0i vi\u1ebft<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/itviec.com\/blog\/markdown-la-gi\/#Markdown_la_gi\" >Markdown l\u00e0 g\u00ec?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/itviec.com\/blog\/markdown-la-gi\/#Cu_phap_cua_Markdown_la_gi\" >C\u00fa ph\u00e1p c\u1ee7a Markdown l\u00e0 g\u00ec?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/itviec.com\/blog\/markdown-la-gi\/#Uu_diem_cua_Markdown\" >\u01afu \u0111i\u1ec3m c\u1ee7a Markdown<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/itviec.com\/blog\/markdown-la-gi\/#Tai_sao_can_chuyen_doi_HTML_sang_Markdown\" >T\u1ea1i sao c\u1ea7n chuy\u1ec3n \u0111\u1ed5i HTML sang Markdown?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/itviec.com\/blog\/markdown-la-gi\/#Chi_tiet_3_cach_chuyen_doi_HTML_to_Markdown_bang_thu_vien_lap_trinh\" >Chi ti\u1ebft 3 c\u00e1ch chuy\u1ec3n \u0111\u1ed5i HTML to Markdown b\u1eb1ng th\u01b0 vi\u1ec7n l\u1eadp tr\u00ecnh\u00a0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/itviec.com\/blog\/markdown-la-gi\/#Cau_hoi_thuong_gap_ve_chuyen_doi_HTML_thanh_Markdown\" >C\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p v\u1ec1 chuy\u1ec3n \u0111\u1ed5i HTML th\u00e0nh Markdown<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/itviec.com\/blog\/markdown-la-gi\/#Tong_ket\" >T\u1ed5ng k\u1ebft<\/a><\/li><\/ul><\/nav><\/div>\n<p><em><strong>Chuy\u1ec3n \u0111\u1ed5i HTML to Markdown s\u1ebd gi\u00fap l\u1eadp tr\u00ecnh vi\u00ean x\u1eed l\u00fd d\u1eef li\u1ec7u \u0111\u1ea7u ra cho c\u00e1c h\u1ec7 th\u1ed1ng vi\u1ebft t\u00e0i li\u1ec7u, blog t\u0129nh ho\u1eb7c t\u1ef1 \u0111\u1ed9ng h\u00f3a trong CI\/CD. B\u00e0i vi\u1ebft n\u00e0y s\u1ebd t\u1eadp trung v\u00e0o c\u00e1ch s\u1eed d\u1ee5ng c\u00e1c th\u01b0 vi\u1ec7n l\u1eadp tr\u00ecnh b\u1eb1ng JavaScript, Node.js v\u00e0 PHP \u0111\u1ec3 th\u1ef1c hi\u1ec7n vi\u1ec7c chuy\u1ec3n \u0111\u1ed5i m\u1ed9t c\u00e1ch linh ho\u1ea1t, d\u1ec5 t\u00f9y bi\u1ebfn v\u00e0 d\u1ec5 t\u00edch h\u1ee3p v\u00e0o c\u00e1c project th\u1ef1c t\u1ebf.\u00a0<\/strong><\/em><\/p>\n<p><span style=\"font-weight: 400;\">\u0110\u1ecdc b\u00e0i vi\u1ebft sau \u0111\u1ec3 \u0111\u01b0\u1ee3c gi\u1ea3i \u0111\u00e1p chi ti\u1ebft h\u01a1n v\u1ec1:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Markdown l\u00e0 g\u00ec? T\u1ea1i sao c\u1ea7n chuy\u1ec3n \u0111\u1ed5i d\u1eef li\u1ec7u t\u1eeb HTML to Markdown?<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">H\u01b0\u1edbng d\u1eabn chi ti\u1ebft 3 c\u00e1ch chuy\u1ec3n \u0111\u1ed5i HTML sang Markdown b\u1eb1ng th\u01b0 vi\u1ec7n l\u1eadp tr\u00ecnh: JavaScript, Python v\u00e0 PHP.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">M\u1ed9t s\u1ed1 c\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p khi chuy\u1ec3n \u0111\u1ed5i d\u1eef li\u1ec7u t\u1eeb HTML sang Markdown.\u00a0<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Markdown_la_gi\"><\/span><b>Markdown l\u00e0 g\u00ec?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Markdown l\u00e0 m\u1ed9t ng\u00f4n ng\u1eef \u0111\u00e1nh d\u1ea5u nh\u1eb9 (lightweight markup language), \u0111\u01b0\u1ee3c John Gruber t\u1ea1o ra v\u00e0o n\u0103m 2004. Markdown hi\u1ec7n l\u00e0 m\u1ed9t trong nh\u1eefng ng\u00f4n ng\u1eef \u0111\u00e1nh d\u1ea5u ph\u1ed5 bi\u1ebfn nh\u1ea5t th\u1ebf gi\u1edbi.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Ph\u1ea7n m\u1edf r\u1ed9ng c\u1ee7a t\u1ec7p Markdown l\u00e0 .md ho\u1eb7c .markdown. \u0110\u1ec3 chuy\u1ec3n \u0111\u1ed5i t\u1ec7p Markdown, b\u1ea1n c\u1ea7n m\u1ed9t \u1ee9ng d\u1ee5ng c\u00f3 kh\u1ea3 n\u0103ng x\u1eed l\u00fd c\u00e1c t\u1ec7p markdown nh\u01b0 Visual Studio Code, Typora, Dillinger, Obsidian ho\u1eb7c Mark Text, Dillinger,&#8230; C\u00e1c \u1ee9ng d\u1ee5ng n\u00e0y s\u1eed d\u1ee5ng b\u1ed9 x\u1eed l\u00fd ho\u1eb7c tr\u00ecnh ph\u00e2n t\u00edch c\u00fa ph\u00e1p Markdown \u0111\u1ec3 chuy\u1ec3n \u0111\u1ed5i t\u1ec7p markdown th\u00e0nh m\u00e3 HTML c\u00f3 th\u1ec3 in \u0111\u01b0\u1ee3c.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Cu_phap_cua_Markdown_la_gi\"><\/span><b>C\u00fa ph\u00e1p c\u1ee7a Markdown l\u00e0 g\u00ec?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">D\u01b0\u1edbi \u0111\u00e2y l\u00e0 nh\u1eefng c\u00fa ph\u00e1p c\u1ee7a Markdown c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c d\u00f9ng l\u00e0m t\u00e0i li\u1ec7u tham kh\u1ea3o khi b\u1ea1n vi\u1ebft m\u00e3 Markdown.<\/span><\/p>\n<h3><b>Heading<\/b><\/h3>\n<pre><span style=\"font-weight: 400;\"># Header1<\/span>\r\n\r\n<span style=\"font-weight: 400;\">## Header2<\/span>\r\n\r\n<span style=\"font-weight: 400;\">### Header3<\/span>\r\n\r\n<span style=\"font-weight: 400;\">#### Header4<\/span>\r\n\r\n<span style=\"font-weight: 400;\">....<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">K\u1ebft qu\u1ea3 hi\u1ec3n th\u1ecb c\u1ee7a \u0111o\u1ea1n m\u00e3 tr\u00ean:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-86438\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/html-to-markdown-la-gi-1-vippro.jpg\" alt=\"markdown l\u00e0 g\u00ec - html to markdown - itviec blog\" width=\"274\" height=\"283\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/html-to-markdown-la-gi-1-vippro.jpg 274w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/html-to-markdown-la-gi-1-vippro-194x200.jpg 194w\" sizes=\"auto, (max-width: 274px) 100vw, 274px\" \/><\/p>\n<h3><b>\u0110\u1ecbnh d\u1ea1ng<\/b><\/h3>\n<pre><span style=\"font-weight: 400;\">*This is Italic*<\/span>\r\n<span style=\"font-weight: 400;\">_This is also Italic_<\/span>\r\n\r\n<span style=\"font-weight: 400;\">**This is bold**<\/span>\r\n<span style=\"font-weight: 400;\">__This is also bold__<\/span>\r\n\r\n<span style=\"font-weight: 400;\">__This is a **combination**__<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">K\u1ebft qu\u1ea3 hi\u1ec3n th\u1ecb c\u1ee7a \u0111o\u1ea1n m\u00e3 tr\u00ean:<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-86437\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/html-to-markdown-la-gi-2-vippro.jpg\" alt=\"markdown l\u00e0 g\u00ec - html to markdown - itviec blog\" width=\"364\" height=\"294\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/html-to-markdown-la-gi-2-vippro.jpg 364w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/html-to-markdown-la-gi-2-vippro-300x242.jpg 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/html-to-markdown-la-gi-2-vippro-200x162.jpg 200w\" sizes=\"auto, (max-width: 364px) 100vw, 364px\" \/><\/p>\n<h3><b>Danh s\u00e1ch\u00a0<\/b><\/h3>\n<pre><span style=\"font-weight: 400;\">1. One\r\n<\/span><span style=\"font-weight: 400;\">2. Two\r\n<\/span><span style=\"font-weight: 400;\">3. Three<\/span>\r\n<span style=\"font-weight: 400;\">\r\n- Elem 1<\/span>\r\n<span style=\"font-weight: 400;\">- Elem 2<\/span>\r\n\r\n<span style=\"font-weight: 400;\">* Member<\/span>\r\n<span style=\"font-weight: 400;\">* Another Member<\/span>\r\n\r\n<span style=\"font-weight: 400;\">- Elem Main<\/span>\r\n<span style=\"font-weight: 400;\">- Another one<\/span>\r\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0- Sub list<\/span>\r\n<span style=\"font-weight: 400;\">\u00a0\u00a0\u00a0\u00a0- It's Member<\/span><\/pre>\n<p>K\u1ebft qu\u1ea3 hi\u1ec3n th\u1ecb c\u1ee7a \u0111o\u1ea1n m\u00e3 tr\u00ean:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-86436\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/html-to-markdown-la-gi-3-vippro.jpg\" alt=\"markdown l\u00e0 g\u00ec - html to markdown - itviec blog\" width=\"310\" height=\"516\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/html-to-markdown-la-gi-3-vippro.jpg 310w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/html-to-markdown-la-gi-3-vippro-180x300.jpg 180w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/html-to-markdown-la-gi-3-vippro-120x200.jpg 120w\" sizes=\"auto, (max-width: 310px) 100vw, 310px\" \/><\/p>\n<h3><b>H\u00ecnh \u1ea3nh v\u00e0 li\u00ean k\u1ebft<\/b><\/h3>\n<pre><span style=\"font-weight: 400;\">IMAGE :<\/span>\r\n<span style=\"font-weight: 400;\">![ITviecs Logo](https:\/\/itviec.com\/assets\/logo-itviec-4492a2f2577a15a0a1d55444c21c0fa55810822b3b189fc689b450fb62ce0b5b.png)<\/span>\r\n\r\n<span style=\"font-weight: 400;\"> \u00a0\u00a0\u00a0LINK :<\/span>\r\n<span style=\"font-weight: 400;\">[ITviec](https:\/\/itviec.com\/)<\/span><\/pre>\n<h3><b>M\u00e3 v\u00e0 c\u00e2u tr\u00edch (c\u00e2u quote)<\/b><\/h3>\n<pre><span style=\"font-weight: 400;\">```<\/span>\r\n\r\n<span style=\"font-weight: 400;\">Html<\/span>\r\n\r\n<span style=\"font-weight: 400;\">&lt;h1&gt;\u0111\u00e2y l\u00e0 code block&lt;\/h1&gt;<\/span>\r\n<span style=\"font-weight: 400;\">```<\/span>\r\n\r\n<span style=\"font-weight: 400;\">Here Code is `Inline` .<\/span>\r\n\r\n<span style=\"font-weight: 400;\">&gt; These are<\/span>\r\n\r\n<span style=\"font-weight: 400;\">&gt; Some Quotes<\/span><\/pre>\n<p>K\u1ebft qu\u1ea3 hi\u1ec3n th\u1ecb c\u1ee7a \u0111o\u1ea1n m\u00e3 tr\u00ean:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-86435\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/html-to-markdown-la-gi-4-vippro.jpg\" alt=\"markdown l\u00e0 g\u00ec - html to markdown - itviec blog\" width=\"591\" height=\"271\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/html-to-markdown-la-gi-4-vippro.jpg 591w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/html-to-markdown-la-gi-4-vippro-300x138.jpg 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/html-to-markdown-la-gi-4-vippro-200x92.jpg 200w\" sizes=\"auto, (max-width: 591px) 100vw, 591px\" \/><\/p>\n<h3><b>Checklist<\/b><\/h3>\n<pre><span style=\"font-weight: 400;\">- [x] Vi\u1ec7c \u0111\u00e3 xong\u00a0\u00a0<\/span>\r\n\r\n<span style=\"font-weight: 400;\">- [ ] Vi\u1ec7c ch\u01b0a xong<\/span><\/pre>\n<p>K\u1ebft qu\u1ea3 hi\u1ec3n th\u1ecb c\u1ee7a \u0111o\u1ea1n m\u00e3 tr\u00ean:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-86434\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/html-to-markdown-la-gi-5-vippro.jpg\" alt=\"markdown l\u00e0 g\u00ec - html to markdown - itviec blog\" width=\"340\" height=\"94\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/html-to-markdown-la-gi-5-vippro.jpg 340w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/html-to-markdown-la-gi-5-vippro-300x83.jpg 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/html-to-markdown-la-gi-5-vippro-200x55.jpg 200w\" sizes=\"auto, (max-width: 340px) 100vw, 340px\" \/><\/p>\n<h3><b>B\u1ea3ng<\/b><\/h3>\n<pre><span style=\"font-weight: 400;\">| T\u00ean | Tu\u1ed5i | Ngh\u1ec1 nghi\u1ec7p |<\/span>\r\n\r\n<span style=\"font-weight: 400;\">|---------|------|----------------|<\/span>\r\n\r\n<span style=\"font-weight: 400;\">| An | 25 | L\u1eadp tr\u00ecnh vi\u00ean |<\/span>\r\n\r\n<span style=\"font-weight: 400;\">| B\u00ecnh | 30 | Thi\u1ebft k\u1ebf |<\/span><\/pre>\n<p>K\u1ebft qu\u1ea3 hi\u1ec3n th\u1ecb c\u1ee7a \u0111o\u1ea1n m\u00e3 tr\u00ean:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-86433\" src=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/html-to-markdown-la-gi-6-vippro.jpg\" alt=\"markdown l\u00e0 g\u00ec - html to markdown - itviec blog\" width=\"367\" height=\"226\" srcset=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/html-to-markdown-la-gi-6-vippro.jpg 367w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/html-to-markdown-la-gi-6-vippro-300x185.jpg 300w, https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/html-to-markdown-la-gi-6-vippro-200x123.jpg 200w\" sizes=\"auto, (max-width: 367px) 100vw, 367px\" \/><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Uu_diem_cua_Markdown\"><\/span><b>\u01afu \u0111i\u1ec3m c\u1ee7a Markdown<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Markdown s\u1ebd gi\u00fap t\u1ea1o c\u00e1c th\u00e0nh ph\u1ea7n HTML c\u01a1 b\u1ea3n m\u00e0 b\u1ea1n th\u1ea5y tr\u00ean trang web nh\u01b0 v\u0103n b\u1ea3n, danh s\u00e1ch, li\u00ean k\u1ebft, h\u00ecnh \u1ea3nh v\u00e0 nhi\u1ec1u th\u00e0nh ph\u1ea7n kh\u00e1c. \u01afu \u0111i\u1ec3m c\u1ee7a Markdown l\u00e0:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">C\u00f3 th\u1ec3 chuy\u1ec3n \u0111\u1ed5i sang c\u00e1c \u0111\u1ecbnh d\u1ea1ng nh\u01b0 PDF, HTML, t\u00e0i li\u1ec7u,&#8230;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">B\u1ea1n c\u00f3 th\u1ec3 \u0111\u1ecbnh d\u1ea1ng n\u1ed9i dung email b\u1eb1ng Markdown v\u1edbi MarkdownHere.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\u0110\u01b0\u1ee3c s\u1eed d\u1ee5ng r\u1ed9ng r\u00e3i \u0111\u1ec3 vi\u1ebft c\u00e1c trang \u0111\u01b0\u1ee3c \u0111\u1ecbnh d\u1ea1ng tr\u00ean nhi\u1ec1u n\u1ec1n t\u1ea3ng kh\u00e1c nhau nh\u01b0 StackOverflow, Github v\u00e0 nhi\u1ec1u n\u1ec1n t\u1ea3ng kh\u00e1c.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">File Markdown c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c chuy\u1ec3n \u0111\u1ed5i th\u00e0nh trang web b\u1eb1ng c\u00e1c c\u00f4ng c\u1ee5 nh\u01b0 Github Pages, blot.im v\u00e0 smallvictori.es.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Khi n\u1ed9i dung g\u1ed1c \u1edf d\u1ea1ng Markdown, b\u1ea1n c\u00f3 th\u1ec3 d\u1ec5 d\u00e0ng chuy\u1ec3n l\u1ea1i th\u00e0nh HTML khi c\u1ea7n s\u1eed d\u1ee5ng tr\u00ean website m\u00e0 kh\u00f4ng lo m\u1ea5t d\u1eef li\u1ec7u \u0111\u1ecbnh d\u1ea1ng.<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Tai_sao_can_chuyen_doi_HTML_sang_Markdown\"><\/span><b>T\u1ea1i sao c\u1ea7n chuy\u1ec3n \u0111\u1ed5i HTML sang Markdown?<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">M\u1ed9t s\u1ed1 l\u00fd do ph\u1ed5 bi\u1ebfn khi b\u1ea1n c\u1ea7n chuy\u1ec3n \u0111\u1ed5i HTML sang Markdown nh\u01b0:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>D\u1ec5 ch\u1ec9nh s\u1eeda v\u00e0 \u0111\u1ecdc hi\u1ec3u h\u01a1n:<\/b><span style=\"font-weight: 400;\"> Markdown c\u00f3 c\u00fa ph\u00e1p \u0111\u01a1n gi\u1ea3n, r\u00f5 r\u00e0ng, gi\u00fap l\u1eadp tr\u00ecnh vi\u00ean hay ng\u01b0\u1eddi d\u00f9ng kh\u00f4ng chuy\u00ean d\u1ec5 d\u00e0ng \u0111\u1ecdc, ch\u1ec9nh s\u1eeda n\u1ed9i dung.\u00a0<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>T\u1ed1i \u01b0u h\u00f3a t\u00e0i li\u1ec7u cho h\u1ec7 th\u1ed1ng qu\u1ea3n l\u00fd n\u1ed9i dung (CMS):<\/b><span style=\"font-weight: 400;\"> GitHub, GitLab, Notion, ho\u1eb7c c\u00e1c n\u1ec1n t\u1ea3ng vi\u1ebft blog (Hugo, Jekyll) \u0111\u1ec1u h\u1ed7 tr\u1ee3 t\u1ed1t Markdown h\u01a1n HTML.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>D\u1ec5 t\u00edch h\u1ee3p v\u00e0o quy tr\u00ecnh DevOps:<\/b><span style=\"font-weight: 400;\"> Trong c\u00e1c d\u1ef1 \u00e1n CI\/CD, vi\u1ec7c l\u01b0u tr\u1eef t\u00e0i li\u1ec7u d\u01b0\u1edbi \u0111\u1ecbnh d\u1ea1ng Markdown gi\u00fap t\u1ef1 \u0111\u1ed9ng h\u00f3a t\u1ed1t h\u01a1n. B\u1edfi v\u00ec Markdown c\u00f3 c\u1ea5u tr\u00fac \u0111\u01a1n gi\u1ea3n, d\u1ec5 \u0111\u1ecdc v\u00e0 d\u1ec5 d\u00e0ng k\u1ebft h\u1ee3p v\u1edbi c\u00e1c c\u00f4ng c\u1ee5 ki\u1ec3m th\u1eed.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Nh\u1eb9 h\u01a1n, t\u1ea3i nhanh h\u01a1n:<\/b><span style=\"font-weight: 400;\"> Markdown l\u00e0 v\u0103n b\u1ea3n thu\u1ea7n, nh\u1eb9 v\u00e0 d\u1ec5 n\u00e9n h\u01a1n HTML. Khi c\u1ea7n hi\u1ec3n th\u1ecb, Markdown s\u1ebd \u0111\u01b0\u1ee3c chuy\u1ec3n \u0111\u1ed5i sang HTML, nh\u01b0ng b\u1ea3n th\u00e2n t\u1ec7p Markdown r\u1ea5t nh\u1eb9 v\u00e0 ph\u00f9 h\u1ee3p \u0111\u1ec3 d\u00f9ng trong t\u00e0i li\u1ec7u n\u1ed9i b\u1ed9 ho\u1eb7c ghi ch\u00fa d\u1ef1 \u00e1n.\u00a0<\/span><\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Chi_tiet_3_cach_chuyen_doi_HTML_to_Markdown_bang_thu_vien_lap_trinh\"><\/span><b>Chi ti\u1ebft 3 c\u00e1ch chuy\u1ec3n \u0111\u1ed5i HTML to Markdown b\u1eb1ng th\u01b0 vi\u1ec7n l\u1eadp tr\u00ecnh\u00a0<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">N\u1ebfu l\u00e0 l\u1eadp tr\u00ecnh vi\u00ean, b\u1ea1n c\u00f3 th\u1ec3 l\u1ef1a ch\u1ecdn chuy\u1ec3n \u0111\u1ed5i HTML sang Markdown b\u1eb1ng th\u01b0 vi\u1ec7n l\u1eadp tr\u00ecnh nh\u01b0 JavaScript, Python hay PHP. Nh\u1eefng c\u00e1ch n\u00e0y s\u1ebd gi\u00fap b\u1ea1n qu\u00e1 tr\u00ecnh chuy\u1ec3n \u0111\u1ed5i ch\u00ednh x\u00e1c v\u00e0 d\u1ec5 t\u00f9y bi\u1ebfn h\u01a1n. D\u01b0\u1edbi \u0111\u00e2y l\u00e0 chi ti\u1ebft v\u1ec1 3 c\u00e1ch chuy\u1ec3n \u0111\u1ed5i file ph\u1ed5 bi\u1ebfn:<\/span><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Th\u01b0 vi\u1ec7n<\/b><\/td>\n<td><b>C\u00e1ch s\u1eed d\u1ee5ng<\/b><\/td>\n<td><b>\u01afu\/ Nh\u01b0\u1ee3c \u0111i\u1ec3m<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">turndown<\/span><\/p>\n<p><span style=\"font-weight: 400;\">(JavaScript)<\/span><\/td>\n<td>\n<ul>\n<li style=\"text-align: left;\"><span style=\"font-weight: 400;\">C\u00e0i \u0111\u1eb7t b\u1eb1ng npm install turndown<\/span><\/li>\n<li style=\"text-align: left;\"><span style=\"font-weight: 400;\">D\u00f9ng trong frontend ho\u1eb7c k\u1ebft h\u1ee3p Node.js<\/span><\/li>\n<li style=\"text-align: left;\"><span style=\"font-weight: 400;\">Chuy\u1ec3n HTML string v\u1edbi turndownService.turndown(html)<\/span><\/li>\n<\/ul>\n<\/td>\n<td>\n<p style=\"text-align: left;\"><span style=\"font-weight: 400;\">\u01afu \u0111i\u1ec3m:<\/span><\/p>\n<ul style=\"text-align: left;\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">C\u00fa ph\u00e1p \u0111\u01a1n gi\u1ea3n, nh\u1eb9<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">T\u00f9y bi\u1ebfn quy t\u1eafc d\u1ec5 d\u00e0ng<\/span><\/li>\n<\/ul>\n<p style=\"text-align: left;\"><span style=\"font-weight: 400;\">Nh\u01b0\u1ee3c \u0111i\u1ec3m:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400; text-align: left;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Kh\u00f4ng x\u1eed l\u00fd t\u1ed1t HTML ph\u1ee9c t\u1ea1p<\/span><\/li>\n<li style=\"font-weight: 400; text-align: left;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Thi\u1ebfu t\u00ednh n\u0103ng n\u00e2ng cao<\/span><\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">markdownify<\/span><\/p>\n<p><span style=\"font-weight: 400;\">(Python)<\/span><\/td>\n<td>\n<ul>\n<li style=\"text-align: left;\"><span style=\"font-weight: 400;\">C\u00e0i \u0111\u1eb7t qua pip v\u00e0 s\u1eed d\u1ee5ng trong c\u00e1c script Python.\u00a0<\/span><\/li>\n<li style=\"text-align: left;\"><span style=\"font-weight: 400;\">Th\u00edch h\u1ee3p cho c\u00e1c t\u00e1c v\u1ee5 t\u1ef1 \u0111\u1ed9ng h\u00f3a v\u00e0 backend nh\u1ecf.<\/span><\/li>\n<\/ul>\n<\/td>\n<td>\n<p style=\"text-align: left;\"><span style=\"font-weight: 400;\">\u01afu \u0111i\u1ec3m:<\/span><\/p>\n<ul style=\"text-align: left;\">\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">D\u1ec5 s\u1eed d\u1ee5ng v\u00e0 c\u00e0i \u0111\u1eb7t.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Ph\u00f9 h\u1ee3p cho c\u00e1c t\u00e1c v\u1ee5 t\u1ef1 \u0111\u1ed9ng h\u00f3a v\u00e0 chuy\u1ec3n \u0111\u1ed5i \u0111\u01a1n gi\u1ea3n.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Nh\u1eb9 v\u00e0 nhanh.<\/span><\/li>\n<\/ul>\n<p style=\"text-align: left;\"><span style=\"font-weight: 400;\">Nh\u01b0\u1ee3c \u0111i\u1ec3m:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400; text-align: left;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Kh\u00f4ng h\u1ed7 tr\u1ee3 c\u00e1c n\u1ed9i dung HTML ph\u1ee9c t\u1ea1p.<\/span><\/li>\n<li style=\"font-weight: 400; text-align: left;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Ch\u01b0a t\u1ed1i \u01b0u cho c\u00e1c \u1ee9ng d\u1ee5ng quy m\u00f4 l\u1edbn ho\u1eb7c y\u00eau c\u1ea7u t\u00ednh n\u0103ng n\u00e2ng cao.<\/span><\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">league\/html-to-markdown<\/span><\/p>\n<p><span style=\"font-weight: 400;\">(PHP)<\/span><\/td>\n<td>\n<ul>\n<li style=\"text-align: left;\"><span style=\"font-weight: 400;\">C\u00e0i b\u1eb1ng Composer: composer require league\/html-to-markdown<\/span><\/li>\n<li style=\"text-align: left;\"><span style=\"font-weight: 400;\">D\u00f9ng $converter = new HtmlConverter();<\/span><\/li>\n<li style=\"text-align: left;\"><span style=\"font-weight: 400;\">$markdown = $converter-&gt;convert($html);<\/span><\/li>\n<\/ul>\n<\/td>\n<td>\n<p style=\"text-align: left;\"><span style=\"font-weight: 400;\">\u01afu \u0111i\u1ec3m:<\/span><\/p>\n<ul>\n<li style=\"text-align: left;\"><span style=\"font-weight: 400;\">Ph\u00f9 h\u1ee3p v\u1edbi CMS PHP (WordPress, Laravel)<\/span><\/li>\n<li style=\"text-align: left;\"><span style=\"font-weight: 400;\">Chuy\u1ec3n \u0111\u1ed5i tag ph\u1ed5 bi\u1ebfn ch\u00ednh x\u00e1c<\/span><\/li>\n<\/ul>\n<p style=\"text-align: left;\"><span style=\"font-weight: 400;\">Nh\u01b0\u1ee3c \u0111i\u1ec3m:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400; text-align: left;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Kh\u00f4ng h\u1ed7 tr\u1ee3 HTML \u0111\u1ed9ng\/ph\u1ee9c t\u1ea1p<\/span><\/li>\n<li style=\"font-weight: 400; text-align: left;\" aria-level=\"1\"><span style=\"font-weight: 400;\">T\u00f9y bi\u1ebfn \u00edt<\/span><\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3><b>Chuy\u1ec3n \u0111\u1ed5i HTML sang Markdown v\u1edbi th\u01b0 vi\u00ean turndown c\u1ee7a JavaScript<\/b><\/h3>\n<p><a href=\"https:\/\/itviec.com\/blog\/javascript-la-gi\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">JavaScript<\/span><\/a><span style=\"font-weight: 400;\"> l\u00e0 l\u1ef1a ch\u1ecdn ph\u1ed5 bi\u1ebfn n\u1ebfu b\u1ea1n mu\u1ed1n chuy\u1ec3n \u0111\u1ed5i HTML sang Markdown ngay tr\u00ean tr\u00ecnh duy\u1ec7t ho\u1eb7c trong m\u00f4i tr\u01b0\u1eddng client-side. M\u1ed9t trong nh\u1eefng th\u01b0 vi\u1ec7n n\u1ed5i b\u1eadt v\u00e0 d\u1ec5 s\u1eed d\u1ee5ng nh\u1ea5t l\u00e0 <\/span><b>turndown<\/b><span style=\"font-weight: 400;\">.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">B\u1ea1n c\u00f3 th\u1ec3 c\u00e0i \u0111\u1eb7t th\u01b0 vi\u1ec7n turndown b\u1eb1ng npm v\u1edbi \u0111o\u1ea1n code <\/span><span style=\"font-weight: 400;\">npm install turndown<\/span><span style=\"font-weight: 400;\"> ho\u1eb7c nh\u00fang \u0111\u01b0\u1eddng d\u1eabn CDN<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">&lt;script src=\"https:\/\/unpkg.com\/turndown\/dist\/turndown.js\"&gt;&lt;\/script&gt;<\/span><span style=\"font-weight: 400;\">.<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5 v\u1ec1 chuy\u1ec3n \u0111\u1ed5i markdown b\u1eb1ng turndown:<\/span><\/p>\n<pre>var TurndownService = require('turndown')\r\n\r\nvar turndownService = new TurndownService()\r\nvar markdown = turndownService.turndown('&lt;h1&gt;Hello world!&lt;\/h1&gt;')<\/pre>\n<p><span style=\"font-weight: 400;\">Ngo\u00e0i ra, Turndown c\u0169ng ch\u1ea5p nh\u1eadn c\u00e1c Node trong\u00a0 DOM l\u00e0m \u0111\u1ea7u v\u00e0o (ho\u1eb7c element nodes, document nodes ho\u1eb7c document fragment nodes):<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">var<\/span><span style=\"font-weight: 400;\"> markdown = turndownService.turndown(<\/span><span style=\"font-weight: 400;\">document<\/span><span style=\"font-weight: 400;\">.getElementById(<\/span><span style=\"font-weight: 400;\">'content'<\/span><span style=\"font-weight: 400;\">))<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Ngo\u00e0i ra, t\u00f9y ch\u1ecdn c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c th\u00f4ng qua v\u00e0o h\u00e0m khi kh\u1edfi t\u1ea1o. Ch\u1eb3ng h\u1ea1n nh\u01b0:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">var<\/span><span style=\"font-weight: 400;\"> turndownService = <\/span><span style=\"font-weight: 400;\">new<\/span><span style=\"font-weight: 400;\"> TurndownService({ option: <\/span><span style=\"font-weight: 400;\">'value'<\/span><span style=\"font-weight: 400;\"> })<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">B\u1ea1n c\u00f3 th\u1ec3 th\u1ef1c hi\u1ec7n chuy\u1ec3n \u0111\u1ed5i v\u1edbi m\u1ed9t s\u1ed1 ph\u01b0\u01a1ng ph\u00e1p th\u01b0\u1eddng \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng trong th\u01b0 vi\u1ec7n turndown nh\u01b0 sau:\u00a0<\/span><\/p>\n<h4><b>addRule(key, rule)<\/b><span style=\"font-weight: 400;\">\u00a0<\/span><\/h4>\n<p><span style=\"font-weight: 400;\">Tham s\u1ed1 key t\u00ean duy nh\u1ea5t cho quy t\u1eafc \u0111\u1ec3 d\u1ec5 tham chi\u1ebfu. V\u00ed d\u1ee5 nh\u01b0:<\/span><\/p>\n<pre>turndownService.addRule('strikethrough', {\r\n\u00a0 filter: ['del', 's', 'strike'],\r\n\u00a0 replacement: function (content) {\r\n\u00a0 \u00a0 return '~' + content + '~'\r\n\u00a0 }\r\n})<\/pre>\n<p><span style=\"font-weight: 400;\">K\u1ebft qu\u1ea3, addRule tr\u1ea3 v\u1ec1 ch\u00ednh instance c\u1ee7a TurndownService, cho ph\u00e9p g\u1ecdi ti\u1ebfp c\u00e1c ph\u01b0\u01a1ng th\u1ee9c kh\u00e1c (method chaining).<\/span><\/p>\n<h4><b>keep(filter)\u00a0<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">Ph\u01b0\u01a1ng ph\u00e1p gi\u00fap x\u00e1c \u0111\u1ecbnh c\u00e1c ph\u1ea7n t\u1eed n\u00e0o s\u1ebd \u0111\u01b0\u1ee3c gi\u1eef nguy\u00ean v\u00e0 hi\u1ec3n th\u1ecb d\u01b0\u1edbi d\u1ea1ng HTML. Theo m\u1eb7c \u0111\u1ecbnh, Turndown kh\u00f4ng gi\u1eef l\u1ea1i b\u1ea5t k\u1ef3 ph\u1ea7n t\u1eed n\u00e0o, do \u0111\u00f3 tham s\u1ed1 filter s\u1ebd ho\u1ea1t \u0111\u1ed9ng gi\u1ed1ng nh\u01b0 m\u1ed9t b\u1ed9 l\u1ecdc quy t\u1eafc. V\u00ed d\u1ee5:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">turndownService.keep([<\/span><span style=\"font-weight: 400;\">'del'<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">'ins'<\/span><span style=\"font-weight: 400;\">])<\/span>\r\n<span style=\"font-weight: 400;\">turndownService.turndown(<\/span><span style=\"font-weight: 400;\">'&lt;p&gt;Hello &lt;del&gt;world&lt;\/del&gt;&lt;ins&gt;World&lt;\/ins&gt;&lt;\/p&gt;'<\/span><span style=\"font-weight: 400;\">) <\/span><span style=\"font-weight: 400;\">\/\/ 'Hello &lt;del&gt;world&lt;\/del&gt;&lt;ins&gt;World&lt;\/ins&gt;'<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">\u0110i\u1ec1u n\u00e0y s\u1ebd hi\u1ec3n th\u1ecb c\u00e1c ph\u1ea7n t\u1eed &lt;del&gt; v\u00e0 &lt;ins&gt; d\u01b0\u1edbi d\u1ea1ng HTML khi \u0111\u01b0\u1ee3c chuy\u1ec3n \u0111\u1ed5i.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">B\u1ea1n c\u00f3 th\u1ec3 g\u1ecdi keep nhi\u1ec1u l\u1ea7n, v\u00e0 m\u1ed7i b\u1ed9 l\u1ecdc keep m\u1edbi th\u00eam v\u00e0o s\u1ebd \u0111\u01b0\u1ee3c \u01b0u ti\u00ean h\u01a1n c\u00e1c b\u1ed9 l\u1ecdc c\u0169. Tuy nhi\u00ean, c\u00e1c b\u1ed9 l\u1ecdc keep n\u00e0y v\u1eabn c\u00f3 th\u1ec3 b\u1ecb ghi \u0111\u00e8 b\u1edfi c\u00e1c quy t\u1eafc chu\u1ea9n c\u1ee7a CommonMark ho\u1eb7c b\u1ea5t k\u1ef3 quy t\u1eafc b\u1ed5 sung n\u00e0o kh\u00e1c. N\u1ebfu b\u1ea1n mu\u1ed1n gi\u1eef l\u1ea1i c\u00e1c ph\u1ea7n t\u1eed m\u00e0 th\u00f4ng th\u01b0\u1eddng s\u1ebd b\u1ecb x\u1eed l\u00fd b\u1edfi nh\u1eefng quy t\u1eafc \u0111\u00f3, h\u00e3y th\u00eam m\u1ed9t quy t\u1eafc ri\u00eang v\u1edbi h\u00e0nh vi b\u1ea1n mong mu\u1ed1n.<\/span><\/p>\n<h4><b>remove(filter)\u00a0<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">remove(filter) s\u1ebd x\u00e1c \u0111\u1ecbnh ph\u1ea7n t\u1eed n\u00e0o s\u1ebd b\u1ecb x\u00f3a ho\u00e0n to\u00e0n, ngh\u0129a l\u00e0 chuy\u1ec3n \u0111\u1ed5i th\u00e0nh chu\u1ed7i r\u1ed7ng. V\u1edbi v\u00ed d\u1ee5 b\u00ean d\u01b0\u1edbi, thao t\u00e1c s\u1ebd x\u00f3a t\u1ea5t c\u1ea3 n\u1ed9i dung c\u00f3 trong ph\u1ea7n t\u1eed &lt;del&gt; :<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">turndownService.remove(<\/span><span style=\"font-weight: 400;\">'del'<\/span><span style=\"font-weight: 400;\">)<\/span>\r\n<span style=\"font-weight: 400;\">turndownService.turndown(<\/span><span style=\"font-weight: 400;\">'&lt;p&gt;Hello &lt;del&gt;world&lt;\/del&gt;&lt;ins&gt;World&lt;\/ins&gt;&lt;\/p&gt;'<\/span><span style=\"font-weight: 400;\">) <\/span><span style=\"font-weight: 400;\">\/\/ 'Hello World'<\/span><\/pre>\n<h4><b>use(plugin|array)<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">S\u1eed d\u1ee5ng m\u1ed9t plugin ho\u1eb7c m\u1ed9t m\u1ea3ng c\u00e1c plugin.<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">\/\/ Import plugins from turndown-plugin-gfm<\/span>\r\n<span style=\"font-weight: 400;\">var<\/span><span style=\"font-weight: 400;\"> turndownPluginGfm = <\/span><span style=\"font-weight: 400;\">require<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">'turndown-plugin-gfm'<\/span><span style=\"font-weight: 400;\">)<\/span>\r\n<span style=\"font-weight: 400;\">var<\/span><span style=\"font-weight: 400;\"> gfm = turndownPluginGfm.gfm<\/span>\r\n<span style=\"font-weight: 400;\">var<\/span><span style=\"font-weight: 400;\"> tables = turndownPluginGfm.tables<\/span>\r\n<span style=\"font-weight: 400;\">var<\/span><span style=\"font-weight: 400;\"> strikethrough = turndownPluginGfm.strikethrough<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\/\/ Use the gfm plugin<\/span>\r\n<span style=\"font-weight: 400;\">turndownService.use(gfm)<\/span>\r\n\r\n<span style=\"font-weight: 400;\">\/\/ Use the table and strikethrough plugins only<\/span>\r\n<span style=\"font-weight: 400;\">turndownService.use([tables, strikethrough])<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">\u0110o\u1ea1n m\u00e3 tr\u00ean \u0111\u00e3 s\u1eed d\u1ee5ng plugin turndown-plugin-gfm \u0111\u1ec3 chuy\u1ec3n \u0111\u1ed5i HTML sang Markdown, \u0111\u1eb7c bi\u1ec7t l\u00e0 theo chu\u1ea9n GitHub Flavored Markdown (GFM).<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>gfm:<\/b><span style=\"font-weight: 400;\"> l\u00e0 m\u1ed9t plugin t\u1ed5ng h\u1ee3p, bao g\u1ed3m nhi\u1ec1u t\u00ednh n\u0103ng c\u1ee7a GFM nh\u01b0 b\u1ea3ng (tables), g\u1ea1ch ngang (strikethrough), danh s\u00e1ch nhi\u1ec7m v\u1ee5 (task list),&#8230;<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>tables:<\/b><span style=\"font-weight: 400;\"> ch\u1ec9 x\u1eed l\u00fd chuy\u1ec3n \u0111\u1ed5i b\u1ea3ng HTML sang b\u1ea3ng Markdown.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>strikethrough:<\/b><span style=\"font-weight: 400;\"> x\u1eed l\u00fd c\u00e1c th\u1ebb &lt;del&gt; ho\u1eb7c \u0111o\u1ea1n v\u0103n b\u1ea3n b\u1ecb g\u1ea1ch ngang.<\/span><\/li>\n<\/ul>\n<h3><b>Chuy\u1ec3n \u0111\u1ed5i HTML sang Markdown v\u1edbi th\u01b0 vi\u1ec7n <\/b><b>markdownify c\u1ee7a Python\u00a0<\/b><\/h3>\n<p><a href=\"https:\/\/itviec.com\/blog\/python-la-gi\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Python<\/span><\/a><span style=\"font-weight: 400;\"> l\u00e0 m\u1ed9t ng\u00f4n ng\u1eef ph\u1ed5 bi\u1ebfn trong x\u1eed l\u00fd d\u1eef li\u1ec7u, web scraping v\u00e0 t\u1ef1 \u0111\u1ed9ng h\u00f3a. N\u1ebfu b\u1ea1n \u0111ang l\u00e0m vi\u1ec7c v\u1edbi n\u1ed9i dung HTML v\u00e0 mu\u1ed1n chuy\u1ec3n \u0111\u1ed5i sang Markdown th\u00ec c\u00f3 th\u1ec3 c\u00e2n nh\u1eafc \u0111\u1ebfn th\u01b0 vi\u1ec7n <\/span><b>markdownify<\/b><span style=\"font-weight: 400;\"> c\u1ee7a Python.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Th\u01b0 vi\u1ec7n s\u1ebd cung c\u1ea5p m\u1ed9t s\u1ed1 t\u00f9y ch\u1ecdn (options) nh\u01b0 sau:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>strip:<\/b><span style=\"font-weight: 400;\"> Cho ph\u00e9p lo\u1ea1i b\u1ecf c\u00e1c th\u1ebb HTML nh\u1ea5t \u0111\u1ecbnh, nh\u01b0ng gi\u1eef l\u1ea1i n\u1ed9i dung v\u0103n b\u1ea3n b\u00ean trong. Kh\u00f4ng th\u1ec3 s\u1eed d\u1ee5ng c\u00f9ng v\u1edbi t\u00f9y ch\u1ecdn convert<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>convert:<\/b><span style=\"font-weight: 400;\"> Danh s\u00e1ch c\u00e1c th\u1ebb HTML c\u1ea7n chuy\u1ec3n \u0111\u1ed5i. Kh\u00f4ng th\u1ec3 s\u1eed d\u1ee5ng c\u00f9ng v\u1edbi t\u00f9y ch\u1ecdn strip<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>autolinks:<\/b><span style=\"font-weight: 400;\"> Boolean, x\u00e1c \u0111\u1ecbnh xem c\u00f3 s\u1eed d\u1ee5ng ki\u1ec3u &#8220;li\u00ean k\u1ebft t\u1ef1 \u0111\u1ed9ng&#8221; khi n\u1ed9i dung c\u1ee7a th\u1ebb &lt;a&gt; kh\u1edbp v\u1edbi href c\u1ee7a n\u00f3 kh\u00f4ng. M\u1eb7c \u0111\u1ecbnh l\u00e0 True<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>default_title:<\/b><span style=\"font-weight: 400;\"> Boolean, cho ph\u00e9p \u0111\u1eb7t ti\u00eau \u0111\u1ec1 c\u1ee7a li\u00ean k\u1ebft b\u1eb1ng href n\u1ebfu kh\u00f4ng c\u00f3 ti\u00eau \u0111\u1ec1. M\u1eb7c \u0111\u1ecbnh l\u00e0 False<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>heading_style:<\/b><span style=\"font-weight: 400;\"> X\u00e1c \u0111\u1ecbnh c\u00e1ch chuy\u1ec3n \u0111\u1ed5i c\u00e1c ti\u00eau \u0111\u1ec1. C\u00e1c gi\u00e1 tr\u1ecb h\u1ee3p l\u1ec7: ATX, ATX_CLOSED, SETEXT, UNDERLINED (alias c\u1ee7a SETEXT). M\u1eb7c \u0111\u1ecbnh l\u00e0 UNDERLINED<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>bullets:<\/b><span style=\"font-weight: 400;\"> M\u1ed9t chu\u1ed7i ho\u1eb7c danh s\u00e1ch c\u00e1c ki\u1ec3u d\u1ea5u \u0111\u1ea7u d\u00f2ng. N\u1ebfu ch\u1ec9 c\u00f3 m\u1ed9t ki\u1ec3u, n\u00f3 s\u1ebd \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng cho t\u1ea5t c\u1ea3 c\u00e1c c\u1ea5p \u0111\u1ed9. M\u1eb7c \u0111\u1ecbnh l\u00e0 *+-.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>strong_em_symbol: <\/b><span style=\"font-weight: 400;\">X\u00e1c \u0111\u1ecbnh k\u00fd t\u1ef1 s\u1eed d\u1ee5ng \u0111\u1ec3 m\u00e3 h\u00f3a v\u0103n b\u1ea3n \u0111\u1eadm ho\u1eb7c nghi\u00eang. C\u00f3 th\u1ec3 l\u00e0 d\u1ea5u sao * (m\u1eb7c \u0111\u1ecbnh) ho\u1eb7c d\u1ea5u g\u1ea1ch d\u01b0\u1edbi _<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>sub_symbol, sup_symbol:<\/b><span style=\"font-weight: 400;\"> X\u00e1c \u0111\u1ecbnh k\u00fd t\u1ef1 bao quanh v\u0103n b\u1ea3n &lt;sub&gt; v\u00e0 &lt;sup&gt;. M\u1eb7c \u0111\u1ecbnh l\u00e0 chu\u1ed7i r\u1ed7ng (h\u00e0nh vi kh\u00f4ng chu\u1ea9n). C\u00f3 th\u1ec3 s\u1eed d\u1ee5ng c\u00e1c k\u00fd t\u1ef1 nh\u01b0 ~ v\u00e0 ^ \u0111\u1ec3 t\u1ea1o ra c\u00e1c d\u1ea1ng nh\u01b0 ~sub~ v\u00e0 ^sup^<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>newline_style<\/b><span style=\"font-weight: 400;\">: X\u00e1c \u0111\u1ecbnh ki\u1ec3u \u0111\u00e1nh d\u1ea5u xu\u1ed1ng d\u00f2ng &lt;br&gt; trong Markdown. M\u1eb7c \u0111\u1ecbnh l\u00e0 SPACES (hai d\u1ea5u c\u00e1ch v\u00e0 m\u1ed9t d\u00f2ng m\u1edbi). N\u1ebfu ch\u1ecdn BACKSLASH, s\u1ebd chuy\u1ec3n \u0111\u1ed5i xu\u1ed1ng d\u00f2ng th\u00e0nh \\\\n<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>code_language:<\/b><span style=\"font-weight: 400;\"> X\u00e1c \u0111\u1ecbnh ng\u00f4n ng\u1eef c\u1ee7a t\u1ea5t c\u1ea3 c\u00e1c ph\u1ea7n &lt;pre&gt;. H\u1eefu \u00edch n\u1ebfu t\u1ea5t c\u1ea3 m\u00e3 tr\u00ean trang s\u1eed d\u1ee5ng c\u00f9ng m\u1ed9t ng\u00f4n ng\u1eef. M\u1eb7c \u0111\u1ecbnh l\u00e0 chu\u1ed7i r\u1ed7ng (&#8221;)<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">V\u00ed d\u1ee5 v\u1ec1 c\u00e1ch chuy\u1ec3n \u0111\u1ed5i HTML sang Markdown b\u1eb1ng th\u01b0 vi\u1ec7n Python:<\/span><\/p>\n<p><b>Chuy\u1ec3n \u0111\u1ed5i th\u1ebb<\/b><span style=\"font-weight: 400;\"> &lt;b&gt; th\u00e0nh ** (Markdown cho ch\u1eef \u0111\u1eadm) v\u00e0 th\u1ebb &lt;a&gt; th\u00e0nh c\u00fa ph\u00e1p li\u00ean k\u1ebft Markdown [GitHub](http:\/\/github.com).<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">from<\/span><span style=\"font-weight: 400;\"> markdownify <\/span><span style=\"font-weight: 400;\">import<\/span><span style=\"font-weight: 400;\"> markdownify <\/span><span style=\"font-weight: 400;\">as<\/span><span style=\"font-weight: 400;\"> md<\/span>\r\n<span style=\"font-weight: 400;\">md(<\/span><span style=\"font-weight: 400;\">'&lt;b&gt;Yay&lt;\/b&gt; &lt;a href=\"http:\/\/github.com\"&gt;GitHub&lt;\/a&gt;'<\/span><span style=\"font-weight: 400;\">)\u00a0 <\/span><span style=\"font-weight: 400;\"># K\u1ebft qu\u1ea3: '**Yay** [GitHub](http:\/\/github.com)'<\/span><\/pre>\n<p><b>Lo\u1ea1i b\u1ecf m\u1ed9t s\u1ed1 th\u1ebb HTML <\/b><span style=\"font-weight: 400;\">b\u1eb1ng c\u00e1ch lo\u1ea1i b\u1ecf th\u1ebb &lt;a&gt; kh\u1ecfi HTML, ch\u1ec9 gi\u1eef l\u1ea1i n\u1ed9i dung c\u1ee7a th\u1ebb &lt;b&gt; chuy\u1ec3n th\u00e0nh **Yay** v\u00e0 gi\u1eef nguy\u00ean &#8220;GitHub&#8221;.<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">from<\/span><span style=\"font-weight: 400;\"> markdownify <\/span><span style=\"font-weight: 400;\">import<\/span><span style=\"font-weight: 400;\"> markdownify <\/span><span style=\"font-weight: 400;\">as<\/span><span style=\"font-weight: 400;\"> md<\/span>\r\n<span style=\"font-weight: 400;\">md(<\/span><span style=\"font-weight: 400;\">'&lt;b&gt;Yay&lt;\/b&gt; &lt;a href=\"http:\/\/github.com\"&gt;GitHub&lt;\/a&gt;'<\/span><span style=\"font-weight: 400;\">, strip=[<\/span><span style=\"font-weight: 400;\">'a'<\/span><span style=\"font-weight: 400;\">])\u00a0 <\/span><span style=\"font-weight: 400;\"># K\u1ebft qu\u1ea3: '**Yay** GitHub'<\/span><\/pre>\n<p><b>Ch\u1ec9 chuy\u1ec3n \u0111\u1ed5i m\u1ed9t s\u1ed1 th\u1ebb HTML <\/b><span style=\"font-weight: 400;\">nh\u01b0 &lt;b&gt; th\u00e0nh Markdown cho ch\u1eef \u0111\u1eadm (**Yay**) v\u00e0 gi\u1eef nguy\u00ean th\u1ebb &lt;a&gt; nh\u01b0 l\u00e0 v\u0103n b\u1ea3n b\u00ecnh th\u01b0\u1eddng &#8220;GitHub&#8221;.<\/span><\/p>\n<pre>from markdownify import markdownify as md\r\nmd('&lt;b&gt;Yay&lt;\/b&gt; &lt;a href=\"http:\/\/github.com\"&gt;GitHub&lt;\/a&gt;', convert=['b'])\u00a0 # K\u1ebft qu\u1ea3: '**Yay** GitHub'<\/pre>\n<h3><b>Chuy\u1ec3n \u0111\u1ed5i HTML sang Markdown v\u1edbi th\u01b0 vi\u1ec7n PHP<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">N\u1ebfu b\u1ea1n \u0111ang l\u00e0m vi\u1ec7c v\u1edbi h\u1ec7 th\u1ed1ng CMS ho\u1eb7c backend vi\u1ebft b\u1eb1ng <\/span><a href=\"https:\/\/itviec.com\/blog\/php-la-gi\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">PHP<\/span><\/a><span style=\"font-weight: 400;\"> (nh\u01b0 WordPress ho\u1eb7c Laravel), b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng th\u01b0 vi\u1ec7n league\/html-to-markdown.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u0110\u1ec3 s\u1eed d\u1ee5ng th\u01b0 vi\u1ec7n, b\u1ea1n s\u1ebd y\u00eau c\u1ea7u th\u01b0 vi\u1ec7n b\u1eb1ng c\u00e1ch s\u1eed d\u1ee5ng d\u00f2ng l\u1ec7nh v\u00e0 th\u00eam require &#8216;vendor\/autoload.php&#8217;; v\u00e0o \u0111\u1ea7u t\u1eadp l\u1ec7nh c\u1ee7a b\u1ea1n.<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">composer <\/span><span style=\"font-weight: 400;\">require<\/span><span style=\"font-weight: 400;\"> league\/html-to-markdown<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Ti\u1ebfp theo, t\u1ea1o m\u1ed9t phi\u00ean b\u1ea3n HtmlConverter m\u1edbi, nh\u1eadp m\u00e3 HTML h\u1ee3p l\u1ec7 c\u1ee7a b\u1ea1n v\u00e0o h\u00e0m convert():<\/span><\/p>\n<pre>use League\\HTMLToMarkdown\\HtmlConverter;\r\n\r\n$converter = new HtmlConverter();\r\n\r\n$html = \"&lt;h3&gt;Nhanh l\u00ean, \u0111\u1ebfn Batpoles!&lt;\/h3&gt;\";\r\n$markdown = $converter-&gt;convert($html);<\/pre>\n<p><span style=\"font-weight: 400;\">Bi\u1ebfn $markdown s\u1ebd ch\u1ee9a phi\u00ean b\u1ea3n Markdown c\u1ee7a HTML c\u1ee7a b\u1ea1n d\u01b0\u1edbi d\u1ea1ng chu\u1ed7i:<\/span><\/p>\n<pre>echo $markdown; \/\/ ==&gt; ### Nhanh l\u00ean, \u0111\u1ebfn Batpoles!<\/pre>\n<h4><b>T\u00f9y ch\u1ecdn chuy\u1ec3n \u0111\u1ed5i (Conversion options)<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">Th\u01b0 vi\u1ec7n league\/html-to-markdown s\u1ebd gi\u1eef l\u1ea1i c\u00e1c th\u1ebb HTML kh\u00f4ng c\u00f3 t\u01b0\u01a1ng \u0111\u01b0\u01a1ng trong Markdown, nh\u01b0 &lt;span&gt;, &lt;div&gt;, &lt;iframe&gt;, &lt;script&gt;,&#8230; Do \u0111\u00f3, b\u1ea1n c\u00f3 th\u1ec3 c\u00e2n nh\u1eafc thi\u1ebft l\u1eadp c\u00e1c t\u00f9y ch\u1ecdn strip_tags, remove_nodes ho\u1eb7c m\u1ed9t th\u01b0 vi\u1ec7n (nh\u01b0 HTML Purifier) \u0111\u1ec3 cung c\u1ea5p th\u00eam b\u1ed9 l\u1ecdc HTML.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u0110\u1ec3 lo\u1ea1i b\u1ecf c\u00e1c th\u1ebb HTML kh\u00f4ng c\u00f3 t\u01b0\u01a1ng \u0111\u01b0\u01a1ng trong Markdown nh\u01b0ng v\u1eabn gi\u1eef l\u1ea1i n\u1ed9i dung b\u00ean trong, b\u1ea1n h\u00e3y \u0111\u1eb7t strip_tags th\u00e0nh true, nh\u01b0 sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">$converter = <\/span><span style=\"font-weight: 400;\">new<\/span><span style=\"font-weight: 400;\"> HtmlConverter(<\/span><span style=\"font-weight: 400;\">array<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">'strip_tags'<\/span><span style=\"font-weight: 400;\"> =&gt; <\/span><span style=\"font-weight: 400;\">true<\/span><span style=\"font-weight: 400;\">));<\/span>\r\n\r\n<span style=\"font-weight: 400;\">$html = <\/span><span style=\"font-weight: 400;\">'&lt;span&gt;Turnips!&lt;\/span&gt;'<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n<span style=\"font-weight: 400;\">$markdown = $converter-&gt;convert($html); <\/span><span style=\"font-weight: 400;\">\/\/ $markdown now contains \"Turnips!\"<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">Ho\u1eb7c \u0111\u1ec3 lo\u1ea1i b\u1ecf c\u1ea3 th\u1ebb v\u00e0 n\u1ed9i dung b\u00ean trong, b\u1ea1n c\u00f3 th\u1ec3 nh\u1eadp v\u00e0o danh s\u00e1ch c\u00e1c th\u1ebb c\u1ea7n lo\u1ea1i b\u1ecf, c\u00e1ch nhau b\u1eb1ng d\u1ea5u c\u00e1ch trong remove_nodes, nh\u01b0 sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">$converter = <\/span><span style=\"font-weight: 400;\">new<\/span><span style=\"font-weight: 400;\"> HtmlConverter(<\/span><span style=\"font-weight: 400;\">array<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">'remove_nodes'<\/span><span style=\"font-weight: 400;\"> =&gt; <\/span><span style=\"font-weight: 400;\">'span div'<\/span><span style=\"font-weight: 400;\">));<\/span>\r\n\r\n<span style=\"font-weight: 400;\">$html = <\/span><span style=\"font-weight: 400;\">'&lt;span&gt;Turnips!&lt;\/span&gt;&lt;div&gt;Monkeys!&lt;\/div&gt;'<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n<span style=\"font-weight: 400;\">$markdown = $converter-&gt;convert($html); <\/span><span style=\"font-weight: 400;\">\/\/ $markdown b\u00e2y gi\u1edd ch\u1ee9a \"\"<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">M\u1eb7c \u0111\u1ecbnh, t\u1ea5t c\u1ea3 c\u00e1c comment HTML s\u1ebd b\u1ecb lo\u1ea1i b\u1ecf kh\u1ecfi n\u1ed9i dung. \u0110\u1ec3 gi\u1eef l\u1ea1i ch\u00fang, b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng t\u00f9y ch\u1ecdn preserve_comments, nh\u01b0 sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">$converter = <\/span><span style=\"font-weight: 400;\">new<\/span><span style=\"font-weight: 400;\"> HtmlConverter(<\/span><span style=\"font-weight: 400;\">array<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">'preserve_comments'<\/span><span style=\"font-weight: 400;\"> =&gt; <\/span><span style=\"font-weight: 400;\">true<\/span><span style=\"font-weight: 400;\">));<\/span>\r\n\r\n<span style=\"font-weight: 400;\">$html = <\/span><span style=\"font-weight: 400;\">'&lt;span&gt;Turnips!&lt;\/span&gt;&lt;!-- Monkeys! --&gt;'<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n<span style=\"font-weight: 400;\">$markdown = $converter-&gt;convert($html); <\/span><span style=\"font-weight: 400;\">\/\/ $markdown now contains \"Turnips!&lt;!-- Monkeys! --&gt;\"<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">\u0110\u1ec3 ch\u1ec9 gi\u1eef l\u1ea1i nh\u1eefng b\u00ecnh lu\u1eadn c\u1ee5 th\u1ec3, b\u1ea1n c\u00f3 th\u1ec3 thi\u1ebft l\u1eadp preserve_comments v\u1edbi m\u1ed9t m\u1ea3ng c\u00e1c chu\u1ed7i, nh\u01b0 sau:<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">$converter = <\/span><span style=\"font-weight: 400;\">new<\/span><span style=\"font-weight: 400;\"> HtmlConverter(<\/span><span style=\"font-weight: 400;\">array<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">'preserve_comments'<\/span><span style=\"font-weight: 400;\"> =&gt; <\/span><span style=\"font-weight: 400;\">array<\/span><span style=\"font-weight: 400;\">(<\/span><span style=\"font-weight: 400;\">'Eggs!'<\/span><span style=\"font-weight: 400;\">)));<\/span>\r\n\r\n<span style=\"font-weight: 400;\">$html = <\/span><span style=\"font-weight: 400;\">'&lt;span&gt;Turnips!&lt;\/span&gt;&lt;!-- Monkeys! --&gt;&lt;!-- Eggs! --&gt;'<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n<span style=\"font-weight: 400;\">$markdown = $converter-&gt;convert($html); <\/span><span style=\"font-weight: 400;\">\/\/ $markdown b\u00e2y gi\u1edd ch\u1ee9a \"Turnips!&lt;!-- Eggs! --&gt;\"<\/span><\/pre>\n<p><span style=\"font-weight: 400;\">M\u1eb7c \u0111\u1ecbnh, c\u00e1c li\u00ean k\u1ebft thay th\u1ebf (placeholder links) s\u1ebd \u0111\u01b0\u1ee3c gi\u1eef l\u1ea1i. \u0110\u1ec3 lo\u1ea1i b\u1ecf c\u00e1c li\u00ean k\u1ebft thay th\u1ebf n\u00e0y, b\u1ea1n c\u00f3 th\u1ec3 s\u1eed d\u1ee5ng t\u00f9y ch\u1ecdn strip_placeholder_links, nh\u01b0 sau:<\/span><\/p>\n<pre>$converter = new HtmlConverter(array('strip_placeholder_links' =&gt; true));\r\n\r\n$html = '&lt;a&gt;Github&lt;\/a&gt;';\r\n$markdown = $converter-&gt;convert($html); \/\/ $markdown b\u00e2y gi\u1edd ch\u1ee9a \"Github\"<\/pre>\n<h4><b>\u0110\u1ecbnh d\u1ea1ng (style options)<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">C\u00e1c th\u1ebb &lt;b&gt; s\u1ebd \u0111\u01b0\u1ee3c chuy\u1ec3n \u0111\u1ed5i b\u1eb1ng c\u00fa ph\u00e1p d\u1ea5u sao (*), v\u00e0 c\u00e1c th\u1ebb &lt;i&gt; s\u1ebd \u0111\u01b0\u1ee3c chuy\u1ec3n \u0111\u1ed5i b\u1eb1ng c\u00fa ph\u00e1p d\u1ea5u g\u1ea1ch d\u01b0\u1edbi (_). B\u1ea1n c\u00f3 th\u1ec3 thay \u0111\u1ed5i c\u00e1c c\u00fa ph\u00e1p n\u00e0y b\u1eb1ng c\u00e1ch s\u1eed d\u1ee5ng c\u00e1c t\u00f9y ch\u1ecdn bold_style v\u00e0 italic_style.<\/span><\/p>\n<pre>$converter = new HtmlConverter();\r\n$converter-&gt;getConfig()-&gt;setOption('italic_style', '*');\r\n$converter-&gt;getConfig()-&gt;setOption('bold_style', '__');\r\n\r\n$html = '&lt;em&gt;Italic&lt;\/em&gt; and a &lt;strong&gt;bold&lt;\/strong&gt;';\r\n$markdown = $converter-&gt;convert($html); \/\/ $markdown now contains \"*Italic* and a __bold__\"<\/pre>\n<h4><b>Ng\u1eaft d\u00f2ng (Line break options)<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">C\u00e1c th\u1ebb &lt;br&gt; s\u1ebd \u0111\u01b0\u1ee3c chuy\u1ec3n \u0111\u1ed5i th\u00e0nh hai d\u1ea5u c\u00e1ch, sau \u0111\u00f3 l\u00e0 k\u00fd t\u1ef1 xu\u1ed1ng d\u00f2ng theo ki\u1ec3u Markdown truy\u1ec1n th\u1ed1ng. N\u1ebfu b\u1ea1n mu\u1ed1n b\u1ecf qua hai d\u1ea5u c\u00e1ch v\u00e0 tu\u00e2n theo quy chu\u1ea9n c\u1ee7a GitHub Flavored Markdown (GFM), h\u00e3y \u0111\u1eb7t hard_break th\u00e0nh true.<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">$converter = <\/span><span style=\"font-weight: 400;\">new<\/span><span style=\"font-weight: 400;\"> HtmlConverter();<\/span>\r\n<span style=\"font-weight: 400;\">$html = <\/span><span style=\"font-weight: 400;\">'&lt;p&gt;test&lt;br&gt;line break&lt;\/p&gt;'<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n\r\n<span style=\"font-weight: 400;\">$converter-&gt;getConfig()-&gt;setOption(<\/span><span style=\"font-weight: 400;\">'hard_break'<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">true<\/span><span style=\"font-weight: 400;\">);<\/span>\r\n<span style=\"font-weight: 400;\">$markdown = $converter-&gt;convert($html); <\/span><span style=\"font-weight: 400;\">\/\/ $markdown now contains \"test\\nline break\"<\/span>\r\n\r\n<span style=\"font-weight: 400;\">$converter-&gt;getConfig()-&gt;setOption(<\/span><span style=\"font-weight: 400;\">'hard_break'<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">false<\/span><span style=\"font-weight: 400;\">); <\/span><span style=\"font-weight: 400;\">\/\/ default<\/span>\r\n<span style=\"font-weight: 400;\">$markdown = $converter-&gt;convert($html); <\/span><span style=\"font-weight: 400;\">\/\/ $markdown now contains \"test\u00a0 \\nline break\"<\/span><\/pre>\n<h4><b>T\u1ef1 \u0111\u1ed9ng li\u00ean k\u1ebft (Autolinking options)<\/b><\/h4>\n<p><span style=\"font-weight: 400;\">M\u1eb7c \u0111\u1ecbnh, c\u00e1c th\u1ebb &lt;a&gt; s\u1ebd \u0111\u01b0\u1ee3c chuy\u1ec3n \u0111\u1ed5i sang c\u00fa ph\u00e1p li\u00ean k\u1ebft \u0111\u01a1n gi\u1ea3n nh\u1ea5t. C\u1ee5 th\u1ec3, n\u1ebfu kh\u00f4ng c\u00f3 n\u1ed9i dung hi\u1ec3n th\u1ecb (text) ho\u1eb7c ti\u00eau \u0111\u1ec1 (title), c\u00fa ph\u00e1p &lt;url&gt; s\u1ebd \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng thay v\u00ec c\u00fa ph\u00e1p \u0111\u1ea7y \u0111\u1ee7 [url](url).<\/span><\/p>\n<p><span style=\"font-weight: 400;\">N\u1ebfu b\u1ea1n mu\u1ed1n lu\u00f4n s\u1eed d\u1ee5ng c\u00fa ph\u00e1p \u0111\u1ea7y \u0111\u1ee7 cho li\u00ean k\u1ebft, h\u00e3y \u0111\u1eb7t use_autolinks th\u00e0nh false.<\/span><\/p>\n<pre><span style=\"font-weight: 400;\">$converter = <\/span><span style=\"font-weight: 400;\">new<\/span><span style=\"font-weight: 400;\"> HtmlConverter();<\/span>\r\n<span style=\"font-weight: 400;\">$html = <\/span><span style=\"font-weight: 400;\">'&lt;p&gt;&lt;a href=\"https:\/\/thephpleague.com\"&gt;https:\/\/thephpleague.com&lt;\/a&gt;&lt;\/p&gt;'<\/span><span style=\"font-weight: 400;\">;<\/span>\r\n\r\n<span style=\"font-weight: 400;\">$converter-&gt;getConfig()-&gt;setOption(<\/span><span style=\"font-weight: 400;\">'use_autolinks'<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">true<\/span><span style=\"font-weight: 400;\">);<\/span>\r\n<span style=\"font-weight: 400;\">$markdown = $converter-&gt;convert($html); <\/span><span style=\"font-weight: 400;\">\/\/ $markdown now contains \"&lt;https:\/\/thephpleague.com&gt;\"<\/span>\r\n\r\n<span style=\"font-weight: 400;\">$converter-&gt;getConfig()-&gt;setOption(<\/span><span style=\"font-weight: 400;\">'use_autolinks'<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">false<\/span><span style=\"font-weight: 400;\">); <\/span><span style=\"font-weight: 400;\">\/\/ default<\/span>\r\n<span style=\"font-weight: 400;\">$markdown = $converter-&gt;convert($html); <\/span><span style=\"font-weight: 400;\">\/\/ $markdown now contains \"[https:\/\/thephpleague.com](https:\/\/thephpleague.com)\"<\/span><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Cau_hoi_thuong_gap_ve_chuyen_doi_HTML_thanh_Markdown\"><\/span><b>C\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p v\u1ec1 chuy\u1ec3n \u0111\u1ed5i HTML th\u00e0nh Markdown<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><b>Markdown c\u00f3 gi\u1ed1ng HTML kh\u00f4ng?<\/b><\/h3>\n<p><b>C\u00e2u tr\u1ea3 l\u1eddi l\u00e0 kh\u00f4ng<\/b><span style=\"font-weight: 400;\">. HTML l\u00e0 ng\u00f4n ng\u1eef \u0111\u00e1nh d\u1ea5u si\u00eau v\u0103n b\u1ea3n c\u00f3 c\u1ea5u tr\u00fac ph\u1ee9c t\u1ea1p h\u01a1n, \u0111\u01b0\u1ee3c s\u1eed d\u1ee5ng \u0111\u1ec3 t\u1ea1o v\u00e0 \u0111\u1ecbnh d\u1ea1ng c\u00e1c trang web. Trong khi \u0111\u00f3, Markdown l\u00e0 ng\u00f4n ng\u1eef \u0111\u00e1nh d\u1ea5u nh\u1eb9 gi\u00fap b\u1ea1n vi\u1ebft n\u1ed9i dung m\u1ed9t c\u00e1ch \u0111\u01a1n gi\u1ea3n v\u1edbi c\u00fa ph\u00e1p d\u1ec5 nh\u1edb, ch\u1ee7 y\u1ebfu ph\u1ee5c v\u1ee5 vi\u1ebft t\u00e0i li\u1ec7u ho\u1eb7c b\u00e0i vi\u1ebft blog.<\/span><\/p>\n<h3><b>C\u00f3 th\u1ec3 s\u1eed d\u1ee5ng HTML trong Markdown kh\u00f4ng?<\/b><\/h3>\n<p><b>C\u00e2u tr\u1ea3 l\u1eddi l\u00e0 c\u00f3<\/b><span style=\"font-weight: 400;\">. Markdown h\u1ed7 tr\u1ee3 ch\u00e8n m\u00e3 HTML tr\u1ef1c ti\u1ebfp. Markdown cho ph\u00e9p ng\u01b0\u1eddi d\u00f9ng s\u1eed d\u1ee5ng HTML \u0111\u1ec3 \u0111\u1ecbnh d\u1ea1ng c\u00e1c c\u1ea5u tr\u00fac ph\u1ee9c t\u1ea1p, ho\u1eb7c khi b\u1ea1n mu\u1ed1n th\u00eam c\u00e1c ph\u1ea7n t\u1eed nh\u01b0 b\u1ea3ng t\u00f9y ch\u1ec9nh, video nh\u00fang ho\u1eb7c c\u00e1c thu\u1ed9c t\u00ednh m\u00e0 c\u00fa ph\u00e1p Markdown kh\u00f4ng h\u1ed7 tr\u1ee3. Tuy nhi\u00ean, kh\u00f4ng ph\u1ea3i t\u1ea5t c\u1ea3 c\u00e1c tr\u00ecnh chuy\u1ec3n \u0111\u1ed5i Markdown \u0111\u1ec1u h\u1ed7 tr\u1ee3 HTML.<\/span><\/p>\n<h3><b>Ai c\u1ea7n s\u1eed d\u1ee5ng tr\u00ecnh chuy\u1ec3n \u0111\u1ed5i HTML sang Markdown?<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Tr\u00ecnh chuy\u1ec3n \u0111\u1ed5i <\/span><b>HTML to Markdown<\/b><span style=\"font-weight: 400;\"> h\u1eefu \u00edch cho nhi\u1ec1u \u0111\u1ed1i t\u01b0\u1ee3ng, bao g\u1ed3m:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>L\u1eadp tr\u00ecnh vi\u00ean:<\/b><span style=\"font-weight: 400;\"> X\u1eed l\u00fd d\u1eef li\u1ec7u t\u1eeb web v\u00e0 chuy\u1ec3n \u0111\u1ed5i n\u1ed9i dung HTML sang Markdown \u0111\u1ec3 s\u1eed d\u1ee5ng trong API ho\u1eb7c h\u1ec7 th\u1ed1ng t\u00e0i li\u1ec7u.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Blogger &amp; Nh\u00e0 vi\u1ebft n\u1ed9i dung: <\/b><span style=\"font-weight: 400;\">Xu\u1ea5t n\u1ed9i dung t\u1eeb tr\u00ecnh so\u1ea1n th\u1ea3o web sang Markdown \u0111\u1ec3 s\u1eed d\u1ee5ng tr\u00ean c\u00e1c n\u1ec1n t\u1ea3ng h\u1ed7 tr\u1ee3 Markdown nh\u01b0 GitHub, Jekyll, Hugo, ho\u1eb7c Notion.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>DevOps &amp; ng\u01b0\u1eddi l\u00e0m CI\/CD:<\/b><span style=\"font-weight: 400;\"> T\u1ea1o t\u00e0i li\u1ec7u t\u1ef1 \u0111\u1ed9ng t\u1eeb d\u1eef li\u1ec7u web ho\u1eb7c email, ph\u1ee5c v\u1ee5 cho h\u1ec7 th\u1ed1ng b\u00e1o c\u00e1o n\u1ed9i b\u1ed9.<\/span><\/li>\n<\/ul>\n<h3><b>Nh\u1eefng l\u1ed7i ph\u1ed5 bi\u1ebfn khi chuy\u1ec3n HTML sang Markdown l\u00e0 g\u00ec?<\/b><\/h3>\n<p><span style=\"font-weight: 400;\">Khi chuy\u1ec3n \u0111\u1ed5i HTML sang Markdown c\u00f3 th\u1ec3 g\u1eb7p m\u1ed9t s\u1ed1 l\u1ed7i ph\u1ed5 bi\u1ebfn nh\u01b0:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>B\u1ecf s\u00f3t th\u1ebb HTML:<\/b><span style=\"font-weight: 400;\"> M\u1ed9t s\u1ed1 th\u01b0 vi\u1ec7n l\u1eadp tr\u00ecnh ch\u1ec9 h\u1ed7 tr\u1ee3 m\u1ed9t t\u1eadp h\u1ee3p c\u00e1c th\u1ebb HTML c\u01a1 b\u1ea3n (&lt;p&gt;, &lt;h1&gt;, &lt;a&gt;, &lt;strong&gt;, &lt;em&gt;, &lt;ul&gt;, &lt;ol&gt;). \u0110\u1ec3 kh\u1eafc ph\u1ee5c, b\u1ea1n ki\u1ec3m tra th\u01b0 vi\u1ec7n c\u00f3 h\u1ed7 tr\u1ee3 chuy\u1ec3n \u0111\u1ed5i m\u1ed9t s\u1ed1 th\u1ebb ph\u1ee9c t\u1ea1p nh\u01b0 &lt;table&gt;, &lt;figure&gt;, ho\u1eb7c &lt;video&gt; hay kh\u00f4ng, ho\u1eb7c vi\u1ebft b\u1ed9 chuy\u1ec3n \u0111\u1ed5i t\u00f9y ch\u1ec9nh.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>X\u1eed l\u00fd sai danh s\u00e1ch l\u1ed3ng nhau:<\/b><span style=\"font-weight: 400;\"> Khi chuy\u1ec3n \u0111\u1ed5i danh s\u00e1ch &lt;ul&gt; ho\u1eb7c &lt;ol&gt;, m\u1ed9t s\u1ed1 th\u01b0 vi\u1ec7n c\u00f3 th\u1ec3 l\u00e0m sai \u0111\u1ecbnh d\u1ea1ng Markdown, \u0111\u1eb7c bi\u1ec7t khi danh s\u00e1ch c\u00f3 nhi\u1ec1u c\u1ea5p. \u0110\u1ec3 kh\u1eafc ph\u1ee5c l\u1ed7i danh s\u00e1ch l\u1ed3ng nhau, b\u1ea1n c\u1ea7n \u0111\u1ea3m b\u1ea3o th\u01b0 vi\u1ec7n h\u1ed7 tr\u1ee3 indent chu\u1ea9n (th\u01b0\u1eddng l\u00e0 2 ho\u1eb7c 4 kho\u1ea3ng tr\u1eafng cho c\u1ea5p \u0111\u1ed9 l\u1ed3ng).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>B\u1ecf qua thu\u1ed9c t\u00ednh ho\u1eb7c class c\u1ee7a HTML:<\/b><span style=\"font-weight: 400;\"> Markdown kh\u00f4ng h\u1ed7 tr\u1ee3 tr\u1ef1c ti\u1ebfp CSS classes ho\u1eb7c inline styles. N\u1ebfu b\u1ea1n chuy\u1ec3n m\u1ed9t \u0111o\u1ea1n HTML c\u00f3 class=&#8221;bold&#8221;, th\u00ec Markdown s\u1ebd kh\u00f4ng th\u1ec3 gi\u1eef nguy\u00ean \u0111\u1ecbnh d\u1ea1ng n\u00e0y.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Kh\u00f4ng h\u1ed7 tr\u1ee3 c\u00e1c k\u00fd t\u1ef1 \u0111\u1eb7c bi\u1ec7t:<\/b><span style=\"font-weight: 400;\"> Markdown s\u1eed d\u1ee5ng m\u1ed9t s\u1ed1 k\u00fd t\u1ef1 \u0111\u1eb7c bi\u1ec7t nh\u01b0 *, _, #, &gt; \u0111\u1ec3 \u0111\u1ecbnh d\u1ea1ng v\u0103n b\u1ea3n. N\u1ebfu HTML c\u00f3 ch\u1ee9a c\u00e1c k\u00fd t\u1ef1 n\u00e0y, nh\u01b0ng th\u01b0 vi\u1ec7n kh\u00f4ng x\u1eed l\u00fd t\u1ed1t, c\u00f3 th\u1ec3 g\u00e2y ra l\u1ed7i c\u00fa ph\u00e1p Markdown.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>L\u1ed7i v\u1ec1 encoding k\u00fd t\u1ef1 (UTF-8):<\/b><span style=\"font-weight: 400;\"> Khi HTML c\u00f3 k\u00fd t\u1ef1 \u0111\u1eb7c bi\u1ec7t ho\u1eb7c ng\u00f4n ng\u1eef kh\u00f4ng ph\u1ea3i ti\u1ebfng Anh (nh\u01b0 ti\u1ebfng Vi\u1ec7t, Nh\u1eadt, Trung), n\u1ebfu encoding kh\u00f4ng chu\u1ea9n UTF-8, Markdown xu\u1ea5t ra c\u00f3 th\u1ec3 b\u1ecb l\u1ed7i font ho\u1eb7c k\u00fd t\u1ef1 b\u1ecb m\u00e3 h\u00f3a sai.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Khi chuy\u1ec3n \u0111\u1ed5i, b\u1ea1n c\u1ea7n ki\u1ec3m tra l\u1ea1i k\u1ebft qu\u1ea3 xu\u1ea5t file c\u1ee7a Markdown kh\u00f4ng b\u1ecb l\u1ed7i danh s\u00e1ch, b\u1ea3ng, ho\u1eb7c m\u1ea5t d\u1eef li\u1ec7u quan tr\u1ecdng. N\u1ebfu Markdown kh\u00f4ng h\u1ed7 tr\u1ee3 t\u00ednh n\u0103ng n\u00e0o \u0111\u00f3, b\u1ea1n c\u00f3 th\u1ec3 gi\u1eef l\u1ea1i HTML ho\u1eb7c chuy\u1ec3n \u0111\u1ed5i theo c\u00e1ch th\u1ee7 c\u00f4ng.<\/span><\/p>\n<h2><span class=\"ez-toc-section\" id=\"Tong_ket\"><\/span><b>T\u1ed5ng k\u1ebft<\/b><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Chuy\u1ec3n \u0111\u1ed5i <\/span><b>HTML to Markdown<\/b><span style=\"font-weight: 400;\"> b\u1eb1ng th\u01b0 vi\u1ec7n l\u1eadp tr\u00ecnh l\u00e0 m\u1ed9t l\u1ef1a ch\u1ecdn ph\u00f9 h\u1ee3p d\u00e0nh cho c\u00e1c l\u1eadp tr\u00ecnh vi\u00ean c\u1ea7n t\u1ef1 \u0111\u1ed9ng h\u00f3a quy tr\u00ecnh ho\u1eb7c x\u1eed l\u00fd n\u1ed9i dung \u0111\u1ed9ng. C\u00e1c th\u01b0 vi\u1ec7n nh\u01b0 JavaScript, Python hay PHP \u0111\u1ec1u cung c\u1ea5p gi\u1ea3i ph\u00e1p nhanh ch\u00f3ng, linh ho\u1ea1t v\u00e0 d\u1ec5 t\u00edch h\u1ee3p. T\u00f9y thu\u1ed9c v\u00e0o ng\u00f4n ng\u1eef v\u00e0 t\u00ednh ch\u1ea5t d\u1ef1 \u00e1n, b\u1ea1n c\u00f3 th\u1ec3 ch\u1ecdn th\u01b0 vi\u1ec7n ph\u00f9 h\u1ee3p \u0111\u1ec3 x\u1eed l\u00fd n\u1ed9i dung HTML m\u00e0 kh\u00f4ng c\u1ea7n thao t\u00e1c th\u1ee7 c\u00f4ng.\u00a0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Hy v\u1ecdng nh\u1eefng g\u1ee3i \u00fd t\u1eeb ITviec s\u1ebd gi\u00fap b\u1ea1n ti\u1ebft ki\u1ec7m th\u1eddi gian v\u00e0 t\u0103ng hi\u1ec7u qu\u1ea3 c\u00f4ng vi\u1ec7c h\u01a1n nh\u00e9!\u00a0<\/span><\/p>\n<blockquote><p><i><span style=\"font-weight: 400;\">Xem th\u00eam: <\/span><\/i><strong><a href=\"https:\/\/itviec.com\/blog\/html-la-gi\/\" target=\"_blank\" rel=\"noopener\"><i>Gi\u1ea3i \u0111\u00e1p \u201ct\u1ea5t t\u1ea7n t\u1eadt\u201d nh\u1eefng \u0111i\u1ec1u c\u1ea7n bi\u1ebft v\u1ec1 HTML<\/i><\/a><\/strong><\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Chuy\u1ec3n \u0111\u1ed5i HTML to Markdown s\u1ebd gi\u00fap l\u1eadp tr\u00ecnh vi\u00ean x\u1eed l\u00fd d\u1eef li\u1ec7u \u0111\u1ea7u ra cho c\u00e1c h\u1ec7 th\u1ed1ng vi\u1ebft t\u00e0i li\u1ec7u, blog t\u0129nh ho\u1eb7c t\u1ef1 \u0111\u1ed9ng h\u00f3a trong CI\/CD. B\u00e0i vi\u1ebft n\u00e0y s\u1ebd t\u1eadp trung v\u00e0o c\u00e1ch s\u1eed d\u1ee5ng c\u00e1c th\u01b0 vi\u1ec7n l\u1eadp tr\u00ecnh b\u1eb1ng JavaScript, Node.js v\u00e0 PHP \u0111\u1ec3 th\u1ef1c hi\u1ec7n vi\u1ec7c [&hellip;]<\/p>\n","protected":false},"author":207,"featured_media":86432,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_gspb_post_css":"","footnotes":""},"categories":[109],"tags":[],"class_list":["post-86428","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-chuyen-mon-it"],"blocksy_meta":[],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.8 (Yoast SEO v27.8) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Markdown l\u00e0 g\u00ec: Chi ti\u1ebft c\u00e1ch chuy\u1ec3n \u0111\u1ed5i HTML sang Markdown - ITviec Blog<\/title>\n<meta name=\"description\" content=\"Chi ti\u1ebft c\u00e1ch chuy\u1ec3n \u0111\u1ed5i HTML sang Markdown b\u1eb1ng th\u01b0 vi\u1ec7n JS, Python, PHP, gi\u00fap Developer, DevOps t\u1ef1 \u0111\u1ed9ng h\u00f3a CI\/CD ho\u1eb7c x\u1eed l\u00fd n\u1ed9i dung \u0111\u1ed9ng.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/itviec.com\/blog\/markdown-la-gi\/\" \/>\n<meta property=\"og:locale\" content=\"vi_VN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Markdown l\u00e0 g\u00ec: Chi ti\u1ebft c\u00e1ch chuy\u1ec3n \u0111\u1ed5i HTML sang Markdown\" \/>\n<meta property=\"og:description\" content=\"Chuy\u1ec3n \u0111\u1ed5i HTML to Markdown s\u1ebd gi\u00fap l\u1eadp tr\u00ecnh vi\u00ean x\u1eed l\u00fd d\u1eef li\u1ec7u \u0111\u1ea7u ra cho c\u00e1c h\u1ec7 th\u1ed1ng vi\u1ebft t\u00e0i li\u1ec7u, blog t\u0129nh ho\u1eb7c t\u1ef1 \u0111\u1ed9ng h\u00f3a trong CI\/CD. B\u00e0i vi\u1ebft\" \/>\n<meta property=\"og:url\" content=\"https:\/\/itviec.com\/blog\/markdown-la-gi\/\" \/>\n<meta property=\"og:site_name\" content=\"ITviec Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ITviec\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-28T15:51:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/markdown-la-gi-vippro-scaled.png\" \/>\n\t<meta property=\"og:image:width\" content=\"640\" \/>\n\t<meta property=\"og:image:height\" content=\"337\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Uyen Ngo\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ITviec\" \/>\n<meta name=\"twitter:site\" content=\"@ITviec\" \/>\n<meta name=\"twitter:label1\" content=\"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi\" \/>\n\t<meta name=\"twitter:data1\" content=\"Uyen Ngo\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc\" \/>\n\t<meta name=\"twitter:data2\" content=\"18 ph\u00fat\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Markdown l\u00e0 g\u00ec: Chi ti\u1ebft c\u00e1ch chuy\u1ec3n \u0111\u1ed5i HTML sang Markdown - ITviec Blog","description":"Chi ti\u1ebft c\u00e1ch chuy\u1ec3n \u0111\u1ed5i HTML sang Markdown b\u1eb1ng th\u01b0 vi\u1ec7n JS, Python, PHP, gi\u00fap Developer, DevOps t\u1ef1 \u0111\u1ed9ng h\u00f3a CI\/CD ho\u1eb7c x\u1eed l\u00fd n\u1ed9i dung \u0111\u1ed9ng.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/itviec.com\/blog\/markdown-la-gi\/","og_locale":"vi_VN","og_type":"article","og_title":"Markdown l\u00e0 g\u00ec: Chi ti\u1ebft c\u00e1ch chuy\u1ec3n \u0111\u1ed5i HTML sang Markdown","og_description":"Chuy\u1ec3n \u0111\u1ed5i HTML to Markdown s\u1ebd gi\u00fap l\u1eadp tr\u00ecnh vi\u00ean x\u1eed l\u00fd d\u1eef li\u1ec7u \u0111\u1ea7u ra cho c\u00e1c h\u1ec7 th\u1ed1ng vi\u1ebft t\u00e0i li\u1ec7u, blog t\u0129nh ho\u1eb7c t\u1ef1 \u0111\u1ed9ng h\u00f3a trong CI\/CD. B\u00e0i vi\u1ebft","og_url":"https:\/\/itviec.com\/blog\/markdown-la-gi\/","og_site_name":"ITviec Blog","article_publisher":"https:\/\/www.facebook.com\/ITviec","article_published_time":"2025-04-28T15:51:00+00:00","og_image":[{"width":640,"height":337,"url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/markdown-la-gi-vippro-scaled.png","type":"image\/png"}],"author":"Uyen Ngo","twitter_card":"summary_large_image","twitter_creator":"@ITviec","twitter_site":"@ITviec","twitter_misc":{"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi":"Uyen Ngo","\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc":"18 ph\u00fat"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/itviec.com\/blog\/markdown-la-gi\/#article","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/markdown-la-gi\/"},"author":{"name":"Uyen Ngo","@id":"https:\/\/itviec.com\/blog\/#\/schema\/person\/f4cd1226846e0258c664e170d3e52d20"},"headline":"Markdown l\u00e0 g\u00ec: Chi ti\u1ebft c\u00e1ch chuy\u1ec3n \u0111\u1ed5i HTML sang Markdown","datePublished":"2025-04-28T15:51:00+00:00","mainEntityOfPage":{"@id":"https:\/\/itviec.com\/blog\/markdown-la-gi\/"},"wordCount":4431,"publisher":{"@id":"https:\/\/itviec.com\/blog\/#organization"},"image":{"@id":"https:\/\/itviec.com\/blog\/markdown-la-gi\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/markdown-la-gi-vippro-scaled.png","articleSection":["Chuy\u00ean m\u00f4n IT"],"inLanguage":"vi"},{"@type":"WebPage","@id":"https:\/\/itviec.com\/blog\/markdown-la-gi\/","url":"https:\/\/itviec.com\/blog\/markdown-la-gi\/","name":"Markdown l\u00e0 g\u00ec: Chi ti\u1ebft c\u00e1ch chuy\u1ec3n \u0111\u1ed5i HTML sang Markdown - ITviec Blog","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/itviec.com\/blog\/markdown-la-gi\/#primaryimage"},"image":{"@id":"https:\/\/itviec.com\/blog\/markdown-la-gi\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/markdown-la-gi-vippro-scaled.png","datePublished":"2025-04-28T15:51:00+00:00","description":"Chi ti\u1ebft c\u00e1ch chuy\u1ec3n \u0111\u1ed5i HTML sang Markdown b\u1eb1ng th\u01b0 vi\u1ec7n JS, Python, PHP, gi\u00fap Developer, DevOps t\u1ef1 \u0111\u1ed9ng h\u00f3a CI\/CD ho\u1eb7c x\u1eed l\u00fd n\u1ed9i dung \u0111\u1ed9ng.","breadcrumb":{"@id":"https:\/\/itviec.com\/blog\/markdown-la-gi\/#breadcrumb"},"inLanguage":"vi","potentialAction":[{"@type":"ReadAction","target":["https:\/\/itviec.com\/blog\/markdown-la-gi\/"]}]},{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/markdown-la-gi\/#primaryimage","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/markdown-la-gi-vippro-scaled.png","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/04\/markdown-la-gi-vippro-scaled.png","width":640,"height":337,"caption":"markdown l\u00e0 g\u00ec - html to markdown - itviec blog"},{"@type":"BreadcrumbList","@id":"https:\/\/itviec.com\/blog\/markdown-la-gi\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Chuy\u00ean m\u00f4n IT","item":"https:\/\/itviec.com\/blog\/chuyen-mon-it\/"},{"@type":"ListItem","position":2,"name":"Markdown l\u00e0 g\u00ec: Chi ti\u1ebft c\u00e1ch chuy\u1ec3n \u0111\u1ed5i HTML sang Markdown"}]},{"@type":"WebSite","@id":"https:\/\/itviec.com\/blog\/#website","url":"https:\/\/itviec.com\/blog\/","name":"ITviec Blog","description":"IT Jobs &amp; People in Vietnam","publisher":{"@id":"https:\/\/itviec.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/itviec.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"vi"},{"@type":"Organization","@id":"https:\/\/itviec.com\/blog\/#organization","name":"ITviec","url":"https:\/\/itviec.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2018\/12\/itviec-black-square-facebook.png","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2018\/12\/itviec-black-square-facebook.png","width":1800,"height":1800,"caption":"ITviec"},"image":{"@id":"https:\/\/itviec.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ITviec","https:\/\/x.com\/ITviec","https:\/\/www.linkedin.com\/company\/itviec","https:\/\/www.youtube.com\/channel\/UCYthAQ3bcGr57M_ag5gHDvQ"]},{"@type":"Person","@id":"https:\/\/itviec.com\/blog\/#\/schema\/person\/f4cd1226846e0258c664e170d3e52d20","name":"Uyen Ngo","image":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/03\/ngo-thieu-my-uyen-author-e1709880420317-100x100.jpg","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/03\/ngo-thieu-my-uyen-author-e1709880420317-100x100.jpg","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/03\/ngo-thieu-my-uyen-author-e1709880420317-100x100.jpg","caption":"Uyen Ngo"},"url":"https:\/\/itviec.com\/blog\/author\/uyen-ngo\/"}]}},"_links":{"self":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/86428","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/users\/207"}],"replies":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/comments?post=86428"}],"version-history":[{"count":0,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/86428\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media\/86432"}],"wp:attachment":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media?parent=86428"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/categories?post=86428"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/tags?post=86428"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}