Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Floki attribute example is ambiguous #501

Closed
maikelthedev opened this issue Nov 28, 2023 · 0 comments
Closed

Floki attribute example is ambiguous #501

maikelthedev opened this issue Nov 28, 2023 · 0 comments
Labels

Comments

@maikelthedev
Copy link

Description

If you go to the Floki.attribute page in the docs the second example of its usage, as it shows appears to be wrong:
image

As you see it, and with no sign of any scrollbar, it appears as if it was

Floki.attribute([{"a", [{"href", "https://google.com/"}, {"data-name", "google"}], ["Google"]}]

when in reality, if you figure somehow that there is a scrollbar and you're not seeing it all, the whole thing is

Floki.attribute([{"a", [{"href", "https://google.com/"}, {"data-name", "google"}], ["Google"]}], "data-name")

The code is not wrong per itself but its presentation. If it could be multiline so the parser of HexDocs doesn't make it look what it isn't I would have guessed (and others too) faster what was wrong with what I was seeing. So just changing on the code something like

Floki.attribute(
    [{"a", [{"href", "https://google.com/"}, {"data-name", "google"}], ["Google"]}], 
    "data-name"
)

Just to ensure half of it is not hidden away, would be ideal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant