if found {
header.ID = string(id.([]byte))
}
- case ast.KindText:
- textNode := n.(*ast.Text)
- headingText.Write(textNode.Text(reader.Source()))
+ case ast.KindText, ast.KindString:
+ headingText.Write(n.Text(reader.Source()))
}
return s, nil
content := `
# Header 1
-## First h2
+## First h2---now with typography!
Some text.
got := b.(converter.TableOfContentsProvider).TableOfContents().ToHTML(2, 3)
c.Assert(got, qt.Equals, `<nav id="TableOfContents">
<ul>
- <li><a href="#first-h2">First h2</a>
+ <li><a href="#first-h2---now-with-typography">First h2—now with typography!</a>
<ul>
<li><a href="#h3">H3</a></li>
</ul>