izyuumi / html2md-rs

HTML to Markdown Parser in Rust
https://crates.io/crates/html2md-rs
MIT License
10 stars 1 forks source link

Do not print `<header>`, `</header>`, `<span...>` and `<span>` tags #28

Closed getreu closed 2 months ago

getreu commented 2 months ago

You already ignore attributes in <span...> tags which is nice. Could you please also refrain from printing out the tags <span...> and </span> itself? It does not add any semantics to the resulting Markdown, but it adds a lot of garbage noise when converting automatically generated HTML.

Secondly, please also ignore the <header> and </header> tags in the output.

izyuumi commented 2 months ago

I think I will do this by creating a wrapper function that takes in parameters to be passed when processing.

izyuumi commented 2 months ago

@getreu Could you provide some short example snippets of code I could use to perform tests?

getreu commented 2 months ago

@izyuumi

On Wed, 2024-06-12 at 23:04 -0700, Yumi Izumi wrote:

@getreu Could you provide some short example snippets of code I could use to perform tests? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.

<!DOCTYPE html><p dir="auto" style="unicode-bidi: plaintext; caret-
color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: Cantarell; font-
size: 14.705309px; font-style: normal; font-variant-caps: normal; font-
weight: 400; letter-spacing: normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none; white-space: normal; widows:
auto; word-spacing: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0,
0.4); -webkit-text-stroke-width: 0px; text-decoration: none;"><a
class="user-mention notranslate" data-hovercard-type="user" data-
hovercard-url="/users/getreu/hovercard" data-octo-click="hovercard-
link-click" data-octo-dimensions="link_type:self"
href="https://github.com/getreu" title="Click to open
https://github.com/getreu">@getreu</a><span class="Apple-converted-
space"> </span>Could you provide some short example snippets of code I
could use to perform tests?</p><p style="unicode-bidi: plaintext; font-
family: Cantarell; font-style: normal; font-variant-caps: normal; font-
weight: 400; letter-spacing: normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none; white-space: normal; widows:
auto; word-spacing: 0px; -webkit-tap-highlight-color: rgba(0, 0, 0,
0.4); -webkit-text-stroke-width: 0px; text-decoration: none; font-size:
small; color: rgb(102, 102, 102);">—<br>Reply to this email
directly,<span class="Apple-converted-space"> </span><a
href="https://github.com/izyuumi/html2md-rs/issues/28#issuecomment-2164514483
" title="Click to open
https://github.com/izyuumi/html2md-rs/issues/28#issuecomment-2164514483
">view it on GitHub</a>, or<span class="Apple-converted-
space"> </span><a
href="https://github.com/notifications/unsubscribe-auth/AAENM"
title="Click to open
https://github.com/notifications/unsubscribe-auth/DAEFM">unsubscribe</a
>.<br>You are receiving this because you were mentioned.<img
src="https://github.com/notifications/beacon/AA3N0C.gif" height="1"
width="1" alt=""></p>