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",
|
"title": "Chapter 2",
|
||||||
"chapters": [
|
"chapters": [
|
||||||
{
|
{
|
||||||
"slug": "2-nested",
|
"slug": "2--nested",
|
||||||
"title": "Chapter 2.1",
|
"title": "Chapter 2.1",
|
||||||
"chapters": [
|
"chapters": [
|
||||||
|
|
||||||
|
|
|
@ -63,19 +63,19 @@ The Rty
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<h2 id="chapter-1-юникод">Chapter 1</h2>
|
<h2 id="chapter--1-юникод">Chapter 1</h2>
|
||||||
<p>
|
<p>
|
||||||
<span>
|
<span>
|
||||||
Chapter 1 paragraph text
|
Chapter 1 paragraph text
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<h2 id="chapter-2">Chapter 2</h2>
|
<h2 id="chapter--2">Chapter 2</h2>
|
||||||
<p>
|
<p>
|
||||||
<span>
|
<span>
|
||||||
Chapter 2 paragraph text
|
Chapter 2 paragraph text
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<h3 id="chapter-2-nested">Chapter 2.1</h3>
|
<h3 id="chapter--2--nested">Chapter 2.1</h3>
|
||||||
<p>
|
<p>
|
||||||
<span>
|
<span>
|
||||||
Chapter 2.1 paragraph text
|
Chapter 2.1 paragraph text
|
||||||
|
|
|
@ -66,11 +66,11 @@ module Repubmark
|
||||||
|
|
||||||
def anchor
|
def anchor
|
||||||
if parent.instance_of?(self.class) && @level > 2
|
if parent.instance_of?(self.class) && @level > 2
|
||||||
"#{parent.anchor}-#@slug"
|
"#{parent.anchor}--#@slug"
|
||||||
elsif anchor_prefix.empty?
|
elsif anchor_prefix.empty?
|
||||||
@slug
|
@slug
|
||||||
else
|
else
|
||||||
"#{anchor_prefix}-#@slug"
|
"#{anchor_prefix}--#@slug"
|
||||||
end.freeze
|
end.freeze
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue