From: Slaughter, A. E <and...@in...> - 2016-09-01 23:55:30
|
Thanks for the response, I bet my problem is the blank lines. I will let you know if I still have a problem after that fix. Peace, Andrew On Thu, Sep 1, 2016 at 4:57 PM, Waylan Limberg <way...@ic...> wrote: > Andrew, > > Sorry for the delayed response. I just found your email in a backlog of > messages in my inbox. > > When you stash something, a placeholder gets inserted into the document. > That placeholder will then get wrapped in `<p>` tags by the Markdown > parser, which results in the behavior you have encountered. To compensate > for this, when swapping out the placeholder for the stash in a > postprocessor, we check if the placeholder is in a paragraph all by itself, > and if the stash starts with a block level HTML element, we replace the > placeholder and the wrapping `p` tag. However, if the `p` tag contains more > that only a placeholder, or the stashed item does not start with a block > level HTML tag, we simple replace the placeholder inside the paragraph, > leaving the `p` tags in place (which is how inline raw HTML is handled). > You can see the code at https://github.com/waylan/ > Python-Markdown/blob/master/markdown/postprocessors.py#L64 > <https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_waylan_Python-2DMarkdown_blob_master_markdown_postprocessors.py-23L64&d=CwMC-g&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=xH34QE8Z7L4jtmH635y9_Hcvm4A8tV88mREFKGfWafk&s=7lzmd8__OWp_00c1fQbhFVkPzWSojsbg6sVBu0om3TU&e=> > . > > `section` tags are considered block level, so if you are not seeing that > behavior, then make sure that there is no whitespace surrounding your tags > (in the stash) and that no whitespace or anything else is included with > your placeholder on a line by itself. Your placeholder should have a blank > line both before and after. > > Waylan Limberg > > On 08/24/2016 12:32 PM, Slaughter, Andrew E wrote: > > I am attempting to stash an opening and closing html tag "<section>" and > "</section>" in certain parts of my markdown in a Preprocessor, which is > working. However, it seems to wrap the injected html within a "<p>" block. > Is there a way to avoid this? > > Thanks, > Andrew > > > ------------------------------------------------------------------------------ > > > > _______________________________________________ > Python-markdown-discuss mailing lis...@li...https://lists.sourceforge.net/lists/listinfo/python-markdown-discuss <https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.sourceforge.net_lists_listinfo_python-2Dmarkdown-2Ddiscuss&d=CwMC-g&c=54IZrppPQZKX9mLzcGdPfFD1hxrcB__aEkJFOKJFd00&r=h7heP8xwI1i_HikChvhFbEBurKirgfOCdwgBxB9lM8c&m=xH34QE8Z7L4jtmH635y9_Hcvm4A8tV88mREFKGfWafk&s=sEQc-PADRs56AFpNIF9wkJqQudsn5myE9IrzFoXInWk&e=> > > > |