Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/markdown2.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
__author__ = "Trent Mick"

import argparse
import html
import logging
import re
import sys
Expand Down Expand Up @@ -1578,7 +1579,7 @@ def header_id_from_text(self,
None to not have an id attribute and to exclude this header from
the TOC (if the "toc" extra is specified).
"""
header_id = _slugify(text)
header_id = _slugify(html.unescape(text))
if prefix and isinstance(prefix, str):
header_id = prefix + '-' + header_id

Expand Down
5 changes: 5 additions & 0 deletions test/tm-cases/header_ids_entity.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<h1 id="escaped-lt">&lt;escaped-lt</h1>

<h1 id="rd-notes">R&amp;D Notes</h1>

<h1 id="normal-header">Normal Header</h1>
1 change: 1 addition & 0 deletions test/tm-cases/header_ids_entity.opts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"extras": ["header-ids"]}
5 changes: 5 additions & 0 deletions test/tm-cases/header_ids_entity.text
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# &lt;escaped-lt

# R&amp;D Notes

# Normal Header
Loading