From: Dr R. W. <rai...@gm...> - 2019-02-12 17:14:26
|
Waylan, sorry for the late reply. On Wednesday, 2019-01-30 19:28:49 -0500, you wrote: > Ah, I see your problem. The change was introduced in #670 > <https://github.com/Python-Markdown/markdown/pull/670>. The thinking > behind that change was that we should only escape things which have > not already been escaped. Of course, `&` is already an HTML entity > so it is escaped and should not be escaped a second time. I slightly help maintaining the documentation of a project hosted at Bitbucket by providing a Python script which locally turns "*.md" files into *.html" files exactly the same way as Bitbucket would do. Accord- ing to Bitbucket they are using Python Markdown with save mode to escape any characters having a special meaning in HTML. To quote from our own Markdown file explaining how to write documentation: This is required because the _Markdown_ language implemented on the Bitbucket server does not pass any HTML entities like for instance "`&`", "`ê`", or the equivalent forms for the latter, "`ê`" and "`ê`", on to the HTML code. Rather it renders "`&`" into "`&amp;`" which will then again be displayed literally as "`&`" by your browser. And this is the HTML generated from the above Markdown source using a Markdown version slightly before #670: <p>This is required because the <em>Markdown</em> language implemented on the Bitbucket server does not pass any HTML entities like for instance "<code>&amp;</code>", "<code>&ecirc;</code>", or the equivalent forms for the latter, "<code>&#234;</code>" and "<code>&#x000EA;</code>", on to the HTML code. Rather it renders "<code>&amp;</code>" into "<code>&amp;amp;</code>" which will then again be displayed literally as "<code>&amp;</code>" by your browser. So all we are needing is a way to modify our "EscapeHtml" extension so that the above Markdown source is still turned into the above HTML text. > ... > I would suggest opening a new issue in GitHub > to discuss any possible future changes to the code. Yes, please do so. And do not hesitate to use the above Markdown and HTML examples as a rationale for this request. Sincerely, Rainer |