Skip to content

Added whitelabeled attributes.#4

Open
dyatlov wants to merge 2 commits intomauidude:masterfrom
dyatlov:master
Open

Added whitelabeled attributes.#4
dyatlov wants to merge 2 commits intomauidude:masterfrom
dyatlov:master

Conversation

@dyatlov
Copy link

@dyatlov dyatlov commented Sep 26, 2015

This allows to have IMG tags displaying correctly in resulting content.

Example:

    doc, err := readability.NewDocument(html)
    if err != nil {
        return
    }

    doc.WhitelistTags = []string{"div", "p", "img"}
    doc.WhitelistAttrs["img"] = []string{"src", "title", "alt"}
    fmt.Println( doc.Content() )

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant