aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/preprocessors.py
diff options
context:
space:
mode:
authorIsaac Muse <faceless.shop@gmail.com>2018-01-04 13:07:45 -0700
committerWaylan Limberg <waylan.limberg@icloud.com>2018-01-04 15:07:45 -0500
commit1de595a4a9c5536d32d597dba799cd036582af0f (patch)
tree3d0a7f5c99938a8fcc1101de252ba0b943e57395 /markdown/preprocessors.py
parentbbada79726d900ef9ae5410ab3a0ce573a742c00 (diff)
downloadmarkdown-1de595a4a9c5536d32d597dba799cd036582af0f.tar.gz
markdown-1de595a4a9c5536d32d597dba799cd036582af0f.tar.bz2
markdown-1de595a4a9c5536d32d597dba799cd036582af0f.zip
Fix raw html reference issue (#585)
Preserve the line which a reference was on to prevent raw HTML indexing issue. Fixes #584. Prevent raw HTML parsing issue in abbr and footnotes Peserve abbreviation line when stripping and preserve a line for each footnote block. Footnotes should also accumulate the extraneous padding. Test extra lines at the end of references Strip the gathered extraneous whitespace When processing footnotes, we don't actually care to process the extra whitespace at the end of a footnote, but we want it to calculate lines to preserve.
Diffstat (limited to 'markdown/preprocessors.py')
-rw-r--r--markdown/preprocessors.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/markdown/preprocessors.py b/markdown/preprocessors.py
index 94f9830..1e99afa 100644
--- a/markdown/preprocessors.py
+++ b/markdown/preprocessors.py
@@ -346,6 +346,9 @@ class ReferencePreprocessor(Preprocessor):
lines.pop(0)
t = tm.group(2) or tm.group(3) or tm.group(4)
self.markdown.references[id] = (link, t)
+ # Preserve the line to prevent raw HTML indexing issue.
+ # https://github.com/Python-Markdown/markdown/issues/584
+ new_text.append('')
else:
new_text.append(line)