I think we are roughly in agreement.  My plan is to look only at the 
indentation of the first line after the cell marker.  Any other lines in 
the cell with heading levels won't - by definition - change the indentation 
of the cell because a cell can only have one indentation level. And cells 
can only start where there is a cell marker.

In my experience, people will use heading levels to get a font size they 
want without thinking about whether semantically they are really indicating 
a section with a different indentation. The same problem happens with HTML 
where people use <h1>, <h2>, etc to get the size font they want, where they 
should style the heading font size with CSS instead.  I don't know if this 
ever happens with jupyter files but we have to assume that it will.

On Monday, October 28, 2024 at 8:37:11 PM UTC-4 [email protected] wrote:

> Oh, I forgot about this edge case
>
> ``` jupytext
> # %% [markdown]
> # ### header 1.1.1
> # content balabalabala 1.1.1
> # #### header 1.1.1.1
> # content balabalabala 1.1.1.1
>
> # %% [markdown]
> # #### header 1.1.1.2
> ```
>
> In this case, only two nodes should be generated:
>
> ```
> ### header 1.1.1
> #### header 1.1.1.2
> ```
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/leo-editor/5fd044e9-efa6-473e-9a20-cbeac171970an%40googlegroups.com.

Reply via email to