amelioration(titre-de-section): saute un niveau de profondeur pour les titres de section

This commit is contained in:
Martin 2023-04-24 11:42:55 +02:00 committed by mfo
parent 4c5e903673
commit 44c84b94ca

View file

@ -4,7 +4,7 @@ class EditableChamp::HeaderSectionComponent < ApplicationComponent
end
def level
@champ.level
@champ.level + 1 # skip one heading level
end
def libelle
@ -20,6 +20,10 @@ class EditableChamp::HeaderSectionComponent < ApplicationComponent
end
def tag_for_depth
"h#{level + 1}"
if level <= 6
"h#{level}"
else
"p"
end
end
end