mixmark-io / turndown

🛏 An HTML to Markdown converter written in JavaScript
https://mixmark-io.github.io/turndown
MIT License
8.93k stars 880 forks source link

The unexpected '\' character in the underline string. #478

Open Naza3 opened 4 months ago

Naza3 commented 4 months ago

for example:

<pre class="cpp" translate="no">
 find_package(Qt6 REQUIRED COMPONENTS Qml)
 target_link_libraries(mytarget PRIVATE Qt6<span class="operator">::</span>Qml)
</pre>

convert to

 find\_package(Qt6 REQUIRED COMPONENTS Qml)
 target\_link\_libraries(mytarget PRIVATE Qt6::Qml)
za3k commented 3 months ago

This is expected, and will render correctly in HTML.

Otherwise, some markdown engines render _ inside a word as italics. https://www.markdownguide.org/basic-syntax/#italic-best-practices