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

Revert the change for renderCompactMarkdown to fix dv.paragraph() with lists #2099

Closed
wants to merge 2 commits into from

Conversation

RyotaUshio
Copy link
Contributor

@RyotaUshio RyotaUshio commented Oct 10, 2023

I noticed the current latest version (fdc0709) has a crucial bug where dv.paragraph(source) doesn't render anything when source contains a list. For example,

```dataviewjs
dv.paragraph(`
- list item 1
- list item 2
`)
```

this should render the following list, but nothing is rendered.

image

I've identified the cause as the change I made to renderCompactMarkdown() in src/ui/render.ts in PR #2089 to alleviate the MathJax flickering issue in the live preview.
(I'm not sure why it caused the problem, but after reverting the list above was rendered correctly.)
Now that the flickering has been entirely eliminated by rewriting the updating process of CM decorations, the change in renderCompactMarkdown() can be reverted without the recurrence of flickering issue.

My apologies for bringing in this bug.

@RyotaUshio RyotaUshio changed the title Revert 7a2b6a1d but only for src/ui/render.ts Revert the change for renderCompactMarkdown to fix dv.paragraph() with lists Oct 10, 2023
@RyotaUshio RyotaUshio deleted the branch blacksmithgu:master October 28, 2023 16:19
@RyotaUshio RyotaUshio closed this Oct 28, 2023
@RyotaUshio RyotaUshio deleted the master branch October 28, 2023 16:19
@RyotaUshio RyotaUshio restored the master branch October 28, 2023 16:21
@RyotaUshio RyotaUshio reopened this Oct 28, 2023
@RyotaUshio
Copy link
Contributor Author

RyotaUshio commented Oct 28, 2023

Closing this as the old version of renderCompactMarkdown (which this PR reverts to) turned out to be likely to be the root cause of the scrolling/flickering issue reported in #2128. I will re-send a PR that will resolve both the list rendering issue mentioned in this PR and the inline field flickering issue mentioned in #2128.

Edit: I filed PR #2131. Note that, as mentioned above, dv.paragraph will not work without this fix!

@RyotaUshio RyotaUshio closed this Oct 28, 2023
RyotaUshio added a commit to RyotaUshio/obsidian-dataview that referenced this pull request Oct 28, 2023
@blacksmithgu
Copy link
Owner

Interesting - thank you!

blacksmithgu pushed a commit that referenced this pull request Oct 29, 2023
…lling in Live Preview (#2131)

* Revert 7a2b6a1 but only for src/ui/render.ts

* Fix the incorrect cursor overlapping check

* Squashed commit of the following:

commit f4e0bdd
Author: RyotaUshio <ushio@ms.k.u-tokyo.ac.jp>
Date:   Sat Oct 14 06:37:10 2023 +0900

    Fix typo

commit 43f3be4
Author: RyotaUshio <ushio@ms.k.u-tokyo.ac.jp>
Date:   Sat Oct 14 06:29:01 2023 +0900

    Fix formatting

commit 74e45e4
Author: RyotaUshio <ushio@ms.k.u-tokyo.ac.jp>
Date:   Sat Oct 14 06:28:32 2023 +0900

    Fix the starting position of an inline field could not obtained correctly after a document change

commit 7570941
Author: RyotaUshio <ushio@ms.k.u-tokyo.ac.jp>
Date:   Sat Oct 14 06:07:03 2023 +0900

    Fix formatting

commit ba7a0a5
Author: RyotaUshio <ushio@ms.k.u-tokyo.ac.jp>
Date:   Sat Oct 14 06:04:27 2023 +0900

    Fix the previous commit works only for the first line

commit 08bcd32
Author: RyotaUshio <ushio@ms.k.u-tokyo.ac.jp>
Date:   Sat Oct 14 05:54:44 2023 +0900

    Resolve #2101: add a click event handler to inline field widgets in live preview

* Squashed commit of the following:

commit 21591ff
Author: RyotaUshio <ushio@ms.k.u-tokyo.ac.jp>
Date:   Sat Oct 14 07:41:40 2023 +0900

    Fix #2107: Prevent inline fields inside a code block from being rendered in live preview

* Squashed commit of the following:

commit f787431
Author: RyotaUshio <ushio@ms.k.u-tokyo.ac.jp>
Date:   Sun Oct 29 00:41:52 2023 +0900

    fix formatting

commit 7205a70
Author: RyotaUshio <ushio@ms.k.u-tokyo.ac.jp>
Date:   Sun Oct 29 00:28:24 2023 +0900

    separate the inline fields rendering option into one for reading view & one for live preview

* fix the auto-scrolling/flickering issue of inline fields (#2128) and dv.paragraph not working for lists (#2099)

* fix formatting

---------

Co-authored-by: RyotaUshio <ushio@ms.k.u-tokyo.ac.jp>
blacksmithgu pushed a commit that referenced this pull request Nov 1, 2023
…whether the call is from `inline-field-live-preview.ts` or not (#2134)

* Revert 7a2b6a1 but only for src/ui/render.ts

* Fix the incorrect cursor overlapping check

* Squashed commit of the following:

commit f4e0bdd
Author: RyotaUshio <ushio@ms.k.u-tokyo.ac.jp>
Date:   Sat Oct 14 06:37:10 2023 +0900

    Fix typo

commit 43f3be4
Author: RyotaUshio <ushio@ms.k.u-tokyo.ac.jp>
Date:   Sat Oct 14 06:29:01 2023 +0900

    Fix formatting

commit 74e45e4
Author: RyotaUshio <ushio@ms.k.u-tokyo.ac.jp>
Date:   Sat Oct 14 06:28:32 2023 +0900

    Fix the starting position of an inline field could not obtained correctly after a document change

commit 7570941
Author: RyotaUshio <ushio@ms.k.u-tokyo.ac.jp>
Date:   Sat Oct 14 06:07:03 2023 +0900

    Fix formatting

commit ba7a0a5
Author: RyotaUshio <ushio@ms.k.u-tokyo.ac.jp>
Date:   Sat Oct 14 06:04:27 2023 +0900

    Fix the previous commit works only for the first line

commit 08bcd32
Author: RyotaUshio <ushio@ms.k.u-tokyo.ac.jp>
Date:   Sat Oct 14 05:54:44 2023 +0900

    Resolve #2101: add a click event handler to inline field widgets in live preview

* Squashed commit of the following:

commit 21591ff
Author: RyotaUshio <ushio@ms.k.u-tokyo.ac.jp>
Date:   Sat Oct 14 07:41:40 2023 +0900

    Fix #2107: Prevent inline fields inside a code block from being rendered in live preview

* Squashed commit of the following:

commit f787431
Author: RyotaUshio <ushio@ms.k.u-tokyo.ac.jp>
Date:   Sun Oct 29 00:41:52 2023 +0900

    fix formatting

commit 7205a70
Author: RyotaUshio <ushio@ms.k.u-tokyo.ac.jp>
Date:   Sun Oct 29 00:28:24 2023 +0900

    separate the inline fields rendering option into one for reading view & one for live preview

* fix the auto-scrolling/flickering issue of inline fields (#2128) and dv.paragraph not working for lists (#2099)

* fix formatting

* Fix #2132 by switching  implementation depending on whether the call is from inline-field-live-preview.ts or not

* switch implementation of `renderCompactMarkdown based on a new boolean parameter, not `component instanceof` test

* remove unnecessary debugging codes & cleanup

---------

Co-authored-by: RyotaUshio <ushio@ms.k.u-tokyo.ac.jp>
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.

2 participants