Skip to content

Commit

Permalink
toc: insert ¶ instead of raw unicode character
Browse files Browse the repository at this point in the history
  • Loading branch information
mitya57 committed Sep 29, 2013
1 parent 6efe758 commit 635d2f7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions markdown/extensions/toc.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from __future__ import unicode_literals
from . import Extension
from ..treeprocessors import Treeprocessor
from ..util import etree, parseBoolValue
from ..util import etree, parseBoolValue, AMP_SUBSTITUTE
from .headerid import slugify, unique, itertext, stashedHTML2text
import re

Expand Down Expand Up @@ -101,8 +101,8 @@ def add_anchor(self, c, elem_id): #@ReservedAssignment

def add_permalink(self, c, elem_id):
permalink = etree.Element("a")
permalink.text = ("\xb6" if self.use_permalinks is True
else self.use_permalinks)
permalink.text = ("%spara;" % AMP_SUBSTITUTE
if self.use_permalinks is True else self.use_permalinks)
permalink.attrib["href"] = "#" + elem_id
permalink.attrib["class"] = "headerlink"
permalink.attrib["title"] = "Permanent link"
Expand Down
8 changes: 4 additions & 4 deletions tests/extensions/toc_nested.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h1 id="header-a">Header A<a class="headerlink" href="#header-a" title="Permanent link"></a></h1>
<h2 id="header-1">Header 1<a class="headerlink" href="#header-1" title="Permanent link"></a></h2>
<h3 id="header-i">Header i<a class="headerlink" href="#header-i" title="Permanent link"></a></h3>
<h1 id="header-b">Header <em>B</em><a class="headerlink" href="#header-b" title="Permanent link"></a></h1>
<h1 id="header-a">Header A<a class="headerlink" href="#header-a" title="Permanent link">&para;</a></h1>
<h2 id="header-1">Header 1<a class="headerlink" href="#header-1" title="Permanent link">&para;</a></h2>
<h3 id="header-i">Header i<a class="headerlink" href="#header-i" title="Permanent link">&para;</a></h3>
<h1 id="header-b">Header <em>B</em><a class="headerlink" href="#header-b" title="Permanent link">&para;</a></h1>
<div class="toc">
<ul>
<li><a href="#header-a">Header A</a><ul>
Expand Down

0 comments on commit 635d2f7

Please sign in to comment.