-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Parsing Exception: CSS selector query doesn't get attribute value #556
Comments
So far we have 3 cases:
I also think about the nested element. But I don't think we need to support it. Users should point it directly to the element contains the info. My solution could break the meaning of selector query. For example we have:
It is pretty close to selector query syntax but act different as all query return |
I see the problem. The solution of allowing the attribute name is a good idea, but
Other solution is to make it more automatic:
|
I have the 3rd case where we wouldn't know what user may need:
It could be child text node from the element or it could be href. I don't mind the |
Sure! PR is very appreciated 👍 |
Tasks: - improve `getDataValue()` function - add test cases - update CHANGELOG
Fix #556 get attribute data from CSS query
Version
2.0.3
Platform
any
What steps will reproduce the bug?
The issue was submitted in discord: https://discord.com/channels/794537085641818124/1197989006789595156/1197989006789595156
_data.yml
<img alt="Reading tracker app with Airtable and Deno Fresh, showing the Airtable and Deno logos." class="feed-image" src="/img/posts/reading-tracker-post-3-large.webp" width="1000">
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior?
The reporter expects to have the
src
set in place of metaog:image
.What do you see instead?
Nothing. the behaviou is correct. But it doesn't make sense for users.
Additional information
The source of problem: https://github.com/lumeland/lume/blob/main/core/utils/data_values.ts#L26
This is an UX bug. This happens due to the convention only return the
innerHTML
. If it is a void element, nothing will returns. The design needs improve or to be removed as it makes users confused. Need further discussion about this feature.The text was updated successfully, but these errors were encountered: