Skip to content

Commit 91e6fc5

Browse files
committed
increase coverage.
1 parent 117c8da commit 91e6fc5

1 file changed

Lines changed: 5 additions & 11 deletions

File tree

textile/core.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -728,31 +728,25 @@ def fBlock(self, tag, atts, ext, cite, content):
728728
return (output['outer_tag'], output['outer_atts'], output['inner_tag'],
729729
output['inner_atts'], output['content'], output['eat'])
730730

731-
def formatFootnote(self, marker, atts='', anchor=True):
732-
if anchor:
733-
pattern = self.glyph_definitions['fn_foot_pattern']
734-
else:
735-
pattern = self.glyph_definitions['fn_ref_pattern']
736-
return pattern.format(**{'atts': atts, 'marker': marker})
737-
738731
def footnoteRef(self, text):
739732
# somehow php-textile gets away with not capturing the space.
740733
return re.compile(r'(?<=\S)\[(?P<id>{0}+)(?P<nolink>!?)\]'
741734
r'(?P<space>{1}?)'.format(regex_snippets['digit'],
742735
regex_snippets['space']), re.U).sub(self.footnoteID, text)
743736

744737
def footnoteID(self, m):
745-
backref = ' class="footnote"'
738+
fn_att = OrderedDict({'class': 'footnote'})
746739
if m.group('id') not in self.fn:
747740
self.fn[m.group('id')] = '{0}{1}'.format(self.linkPrefix,
748741
self._increment_link_index())
749742
fnid = self.fn[m.group('id')]
750-
backref = '{0} id="fnrev{1}"'.format(backref, fnid)
743+
fn_att['id'] = 'fnrev{0}'.format(fnid)
751744
fnid = self.fn[m.group('id')]
752-
footref = '<a href="#fn{0}">{1}</a>'.format(fnid, m.group('id'))
745+
footref = generate_tag('a', m.group('id'), {'href': '#fn{0}'.format(
746+
fnid)})
753747
if '!' == m.group('nolink'):
754748
footref = m.group('id')
755-
footref = self.formatFootnote(footref, backref, False)
749+
footref = generate_tag('sup', footref, fn_att)
756750
return '{0}{1}'.format(footref, m.group('space'))
757751

758752
def glyphs(self, text):

0 commit comments

Comments
 (0)