Editor text-indent and padding-inline-start calculating improperly

Steps to reproduce

  1. Create a note with a tight list in it. (An example will be provided as an attachment.)
  2. Either: Close and re-open the note, or navigate back/forward to and from some other note (forcing the note to re-render in the editor is the goal here).
  3. The note will now have a certain set of inline styles on its HTML for text-indent and padding-inline-start. Input some kind of state change in the app, pretty much anything will work.
  4. The note will recalculate the two properties to use different values than it initialized with. The second values should persist through most state changes, though things which re-render entire views may cause the issue cycle as well (an example shown to me by another user is the Maximize pane command from the Pane Relief plugin.)

Expected result

There should be no reflow of content or change in these properties, as they should hopefully be calculated correctly the first time by whatever internal TypeScript handles them.

Actual result

Content reflows, and the values passed to the style attribute in the element HTML is changed.

Environment

SYSTEM INFO:
	Obsidian version: v1.1.16
	Installer version: v1.1.9
	Operating system: Windows 10 Home 10.0.19043
	Login status: not logged in
	Insider build toggle: off
	Live preview: off
	Legacy editor: off
	Base theme: dark
	Community theme: none
	Snippets enabled: 0
	Restricted mode: off
	Plugins installed: 1
	Plugins enabled: 0

RECOMMENDATIONS:
	none

Additional information

Attachments:

  1. A .gif demonstrating the reflow issue.
    • lorem list 1
  2. A .md file used in the demonstration.
  3. A .png showing the inline style values on view initialization.
    • indent before
  4. A .png showing the inline style values after any sufficient update event.
    • indent after

Let me add that this happens on macOS, too.

Same here on macOS, too.

The most disappointing thing for me is that I cannot even align with spaces in the math/latex block of the source mode, see

this example.

A workaround is to add

.cm-line{
    text-indent: 0 !important;
    padding-inline-start: 0 !important;
}

into CSS Snippets, but I do not know if there are any side-effects as I am not familiar with Obsidian’s source code.

This is a very complex problem. We have done some work in the past to have these jumps be less pronounced. I don’t think that this will be dealt with anytime soon.

Related: https://forum.obsidian.md/t/live-preview-checklist-indentation-is-offset-when-i-navigate-to-another-note-and-back/29938

1 Like

Sounds good, thank you so much for following up!