Double separators for chapter anchors

This commit is contained in:
Alex Kotov 2024-10-18 16:09:41 +04:00
parent 0f83fbc6de
commit 10d7696e40
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
3 changed files with 6 additions and 6 deletions

View file

@ -11,7 +11,7 @@
"title": "Chapter 2",
"chapters": [
{
"slug": "2-nested",
"slug": "2--nested",
"title": "Chapter 2.1",
"chapters": [

View file

@ -63,19 +63,19 @@ The Rty
</div>
</div>
</div>
<h2 id="chapter-1-юникод">Chapter 1</h2>
<h2 id="chapter--1-юникод">Chapter 1</h2>
<p>
<span>
Chapter 1 paragraph text
</span>
</p>
<h2 id="chapter-2">Chapter 2</h2>
<h2 id="chapter--2">Chapter 2</h2>
<p>
<span>
Chapter 2 paragraph text
</span>
</p>
<h3 id="chapter-2-nested">Chapter 2.1</h3>
<h3 id="chapter--2--nested">Chapter 2.1</h3>
<p>
<span>
Chapter 2.1 paragraph text

View file

@ -66,11 +66,11 @@ module Repubmark
def anchor
if parent.instance_of?(self.class) && @level > 2
"#{parent.anchor}-#@slug"
"#{parent.anchor}--#@slug"
elsif anchor_prefix.empty?
@slug
else
"#{anchor_prefix}-#@slug"
"#{anchor_prefix}--#@slug"
end.freeze
end