Skip to content

Is there a way to fallback the original handler after add_handler? #23

Closed

Description

@dreampuf

Hi, I wonder if we can have a customized handler and have a fallback to the default handler after it?

HtmlToMarkdown::builder()
            .add_handler(vec!["img"], move |el: Element| {
                if let Some(src) = find_attrs(el.attrs, "src") {
                    // collecting src
                }
                // fall back to the default img_handler rather than an empty string 
                None
            })

Activity

  1. letmutex commented on May 9, 2025

    @letmutex
    Owner

    Sorry for the late reply, as I've been away from Rust for a while. Regarding this issue, there is currently no fallback mechanism to support this usage. However, there will be a chance to improve the API to support fallback in the future, PRs are also welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions