execute if score #indent0 markdown = #indent1 markdown run data modify storage markdown: paragraph_type append value 0

execute store result score #temp markdown run data get storage markdown: paragraph_type
scoreboard players remove #temp markdown 1
execute if score #temp markdown > #indent1 markdown run function markdown:paragraph/list/ordered/get_order/_
execute store result score #order markdown run data get storage markdown: paragraph_type[-1]
scoreboard players add #order markdown 1
execute store result storage markdown: paragraph_type[-1] int 1 run scoreboard players get #order markdown