-
-
Notifications
You must be signed in to change notification settings - Fork 427
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
Inline fields not rendered correctly in reading view #2216
Comments
For me it happens only when every line is a task
then |
I had some free time today so I played around a bit and found the solution. Unfortunately, I am not a DataView developer so I could experimenting and testing the solution only on the compiled, current version of the plugin (version 0.5.64) by making changes to the BTW. I think the solution should be implemented in export async function replaceInlineFields(ctx: MarkdownPostProcessorContext, init: DataviewInit): Promise<void> {
let inlineFields = extractInlineFields(init.container.innerHTML);
if (inlineFields.length == 0) return;
const info = ctx.getSectionInfo(init.container);
const text = info?.text;
let inlineFieldsFromText: InlineField[] | null = null;
if (text) {
inlineFieldsFromText = extractInlineFields(text.split('\n')[info.lineStart]);
} |
I tried your change, and at first it seemed to do the job. But after a little more testing, it fails again. There might be some caching issues as well. And I'm not sure if this fix tackles both the cases of round and square brackets around the inline fields. I wonder if @RyotaUshio could look into this bug, as they was the one implementing the changes in this part of the code. |
Attached to this comment are two markdown files showcasing how this is an issue for both variants of inline fields. The files also shows how it's just the main inline rendering which fails, and that the various query variants gets it correct. And it's just the reading mode which is affected. t71031 repeated rendering round brackets.md Using Minimal theme the display of the top part of the round version of this test set displays as: |
Yeah, definitelly there is something wrong. But, have you checked the second proposed solution? What I mean is to comment out line 19358 ("parsedValue = parsedValueFromText; |
@holroy Thank you for letting me know, and I'm sorry if my code introduced this bug. I will look into this within a few days. |
Presumably related to this issue is code formatting breaks when
This renders as:
|
Another issue which I'm not sure if it ever has worked or not, but if do like the below it doesn't do inline queries correctly, it seems.
This could be a race condition issue, though, so I'm not quite sure if is supposed to be broken, or if it was broken with these changes, but I've never thought of it before lately, so.... |
We need to consolidate what works and what doesn't work, so could some of you please test the following markdown and report back when values are collated together or not?
When running within the test-vault with only dataview running on the code from 0.5.66, I only get errors related to the following two cases: Multiple fields in list - Reading modeMultiple values in inline fields - Live previewCould you please verify that you see the same behaviour, and please also state which version of Obsidian and which operating system you're using. This test I've conducted on Win11 in Obsidian 1.5.11 (with 1.5.8 installer). |
I've played around some more, and it seems like we might have an issue related to getting the right information back from the Obsidian API. Our code asks for the For the code to work we need it (or a similar method) to return the actual line number of the specific list item, and not the section which contains the list section. Otherwise it'll try to pull inline fields from the entire list (and not local to a given list item). Earlier fixes, and why they fail
|
I'm getting more and more confused on this bug. It disappears it seems if the Tasks plugin is enabled?! The simples use case I've found so far is to:
How are these connected!? What's different when Tasks are enabled? And can we duplicate this bug-fixing behavior? Any ideas @blacksmithgu , @GottZ or @RyotaUshio ? |
sadly I'm on vacation.. I have no clue but suspect that main.ts needs a proper cleanup. |
Related to my earlier attempts on this, and the realisation that the current logic can't be fixed since we don't have access to the exact line of a given list item (which is a key point of the current logic), should we revert the entirety of this change back to version 0.5.59? Or possibly hide it behind some experimental toggle in the settings? This bug keeps hindering me in to give proper responses to guys at the forum, and it reduces the usability of Dataview to such an extent that I'm considering to either revert to version 0.5.59 altogether, or to branch of and start using just my own dedicated version of Dataview without this bug. The original implementer of this change also hasn't responded, and most likely are not able to fix it either due to the poor access to the correct source code. |
What happened?
If multiple of the same inline fields are separated by a single empty line, they are rendered incorrectly. To see this behavior, you must enable the "Enable Inline Field Highlighting in Reading View" option. Simple example:
Can someone confirm this bug?
DQL
No response
JS
No response
Dataview Version
0.5.64
Obsidian Version
1.5.3
OS
Windows
The text was updated successfully, but these errors were encountered: