amelioration(titre-de-section): saute un niveau de profondeur pour les titres de section
This commit is contained in:
parent
4c5e903673
commit
44c84b94ca
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue