execute if data storage markdown: paragraph_type unless data storage markdown: paragraph_type[] run function markdown:paragraph/close
execute unless data storage markdown: paragraph_type run data merge storage markdown: {paragraph:[],paragraph_type:[I;]}

function markdown:paragraph/list/ordered/get_order/

data modify storage markdown: paragraph append from storage markdown:style list
execute store result storage markdown: temp int 1 run scoreboard players get #order markdown
function markdown:paragraph/list/ordered/_ with storage markdown:

scoreboard players operation #temp markdown = #indent1 markdown
execute if score #temp markdown matches 1.. run function markdown:paragraph/list/add_indent
scoreboard players add #indent1 markdown 1

function markdown:line/start
data modify storage markdown: paragraph[-1]."with"[-1]."extra" set from storage markdown: line[0]
execute unless data storage markdown: {target:lore} if data storage markdown: paragraph[1] run data modify storage markdown: paragraph[-2]."with"[-1]."extra" append value "\n"

execute if data storage markdown: str.1 run return run function markdown:document/
return run function markdown:document/eof