Double separators for chapter anchors
This commit is contained in:
parent
0f83fbc6de
commit
10d7696e40
3 changed files with 6 additions and 6 deletions
|
@ -11,7 +11,7 @@
|
|||
"title": "Chapter 2",
|
||||
"chapters": [
|
||||
{
|
||||
"slug": "2-nested",
|
||||
"slug": "2--nested",
|
||||
"title": "Chapter 2.1",
|
||||
"chapters": [
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue