obsidian-linter icon indicating copy to clipboard operation
obsidian-linter copied to clipboard

FR: Header Increment option to affect blockquotes

Open redactedscribe opened this issue 2 years ago • 2 comments

Is Your Feature Request Related to a Problem? Please Describe.

When creating a blockquote with headers contained within them, I'd like them to also be incremented by an option offered by the Header Increment feature.

Describe the Solution You'd Like

There could be the main option to increment headers within blockquotes, and then a sub-option which defines how it works. The sub-option choices could be:

  1. Increment headers within blockquotes according to the position of the blockquote in the document.
  2. Increment headers within blockquotes starting at header level [user-defined].

Please include an example where applicable:

If option 1 is selected, the first header of the blockquote is determined by the parent header outside of the blockquote:

## 2

> ### 3
>
> foo
>
> #### 4
>
> bar

## 2

foo

### 3

bar

If a blockquote is the first item in a document and option 1 is selected, abide by the "Start Header Increment at Heading Level 2" option.

If option 2 is selected, no matter the position of the blockquote, the first headers within it will start at header level X, and any additional ones will increment from there:

## 2

> # 1
>
> foo
>
> ## 2
>
> bar

## 2

foo

### 3

bar

If option 2's X value is set too high, or option 1 is already within a high heading level, the user could reach header level 6 quickly, and subsequent deeper headers should be set to 6 most likely. Option 2 users should likely set the first headers in blockquotes to be something like level 1 or 2.

If a blockquote is the first item in a document and option 2 is selected, probably only headers outside of the blockquote should be considered by the "Start Header Increment at Heading Level 2" option.

Describe Alternatives You've Considered

Manually change headers within blockquotes if their size doesn't fit the current header level's context.

Somewhat related to #719.

Thanks!

redactedscribe avatar Oct 13 '23 13:10 redactedscribe

Thanks for the suggestion.

What exactly happens with blockquote nesting? Typically a nested blockquote is considered to be a new blockquote separate from other blockquotes. So in that case what is supposed to happen since each blockquote is supposed to have a heading that starts at level x as defined by the user in the description here?

pjkaufman avatar Dec 12 '23 13:12 pjkaufman

For option 2 it should be easy. Keep starting at the user-defined level, say H2:

### H4
> ## H2
> ### H3
> > ## H2
> > > ## H2

For option 1, the header levels should simply keep incrementing based on their depth. If the parent header outside the blockquote is already a deep level, the result might be considered less practical by some (H6s are typically not very header-like, by default the same size as normal text, but that is something a user can adjust through CSS if they wish):

### H4
> ##### H5
> ###### H6
> > ###### H6
> > > ###### H6

Alternatively for option 1 (and probably more reasonably), keep restarting header level based upon the the header outside of the blockquotes, similarly as is done for option 2 (this treats each new nesting as a "new blockquote separate from other blockquotes" as you mentioned):

### H4
> ##### H5
> ###### H6
> > ###### H5 <-
> > > ###### H5 <-

Along with option 2: Either two variants for option 1, or solely its alternative would be my suggestion.

redactedscribe avatar Dec 12 '23 15:12 redactedscribe