Skip to content

bug/feature: consider applying stricter rules to derive autolinks #397

@xitep

Description

@xitep
        let input = r#"<a href="foobar.png">foobar.png</a> <a href="https://www.heise.de/">https://www.heise.de/</a>"#;
        assert_eq!(
            html_to_markdown_rs::convert(
                input,
                Some(html_to_markdown_rs::ConversionOptions::default()),
            )
            .unwrap()
            .content
            .as_deref(),
            Some("[foobar.png](foobar.png) <https://www.heise.de>")
        );

i would expect this pass, alas it does not. the link to foobar.png gets turned into a <foobar.png> which, to a human reader, is arguably not intuitive. can html-to-markdown apply some stricture rules when to turn a link into an autolink and when not? here appears to be a nice definition (for gfm): https://github.github.com/gfm/#autolinks ; this is spirit, mdream applies some easy to follow/implements simply rules (https://github.com/harlan-zw/mdream/pull/89/files), which work fine for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions