markdown: Ignore html comments (#28318)

Closes #28300

| Before | After |
| ------ | ----- |
|
![Screenshot_20250408_073355](https://github.com/user-attachments/assets/50dcb56d-bc70-4329-94cb-5b848f265c97)
|
![Screenshot_20250408_073322](https://github.com/user-attachments/assets/ba5c519a-bb34-4724-9c14-3278c6c09afd)
|

Release Notes:

- N/A
This commit is contained in:
Fernando Tagawa 2025-05-06 08:55:07 -03:00 committed by GitHub
parent daba603e27
commit 6e9f8f997e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 53 additions and 1 deletions

View file

@ -537,6 +537,28 @@ mod tests {
);
}
#[test]
fn test_html_comments() {
assert_eq!(
parse_markdown(" <!--\nrdoc-file=string.c\n-->\nReturns"),
(
vec![
(2..30, Start(HtmlBlock)),
(2..2, SubstitutedText(" ".into())),
(2..7, Html),
(7..26, Html),
(26..30, Html),
(2..30, End(MarkdownTagEnd::HtmlBlock)),
(30..37, Start(Paragraph)),
(30..37, Text),
(30..37, End(MarkdownTagEnd::Paragraph))
],
HashSet::new(),
HashSet::new()
)
)
}
#[test]
fn test_plain_urls_and_escaped_text() {
assert_eq!(