h2 y h3 con id

This commit is contained in:
sejo 2021-05-20 15:50:41 -05:00
parent 4ec6257411
commit 38a33534cf
1 changed files with 13 additions and 6 deletions

View File

@ -248,20 +248,27 @@ $0 !~ /^(=>|```|#{1,3} |* |>|[[:blank:]]*$)/{ # líneas de texto (no "especiales
/^## /{ # h2
if(!modo_pre){
sub("##[[:blank:]]+","<h2>",$0)
sub("$","</h2>",$0)
sub("##[[:blank:]]+","",$0)
sub("$","",$0)
# crea header con id
appendContenido( "<h2 id='"$0"'>"$0"</h2>" )
bloque = 1
}
appendContenido( $0 )
else{
appendContenido( $0 )
}
}
/^### /{ # h3
if(!modo_pre){
sub("###[[:blank:]]+","<h3>",$0)
sub("$","</h3>",$0)
sub("###[[:blank:]]+","",$0)
sub("$","",$0)
appendContenido( "<h3 id='"$0"'>"$0"</h3>" )
bloque = 1
}
appendContenido( $0 )
else{
appendContenido( $0 )
}
}
END{