From: Waylan L. <way...@ic...> - 2016-05-24 00:07:24
|
Daniel, Sorry for the delayed response. You are correct that an inlinepattern would not be able to do this alone. Inlinepatterns have no knowledge about the context and no access to the parent. You will probably need to use a combination of multiple different processors. Perhaps an inlinepattern and a treeprocessor. For an example of how to use multiple different processors together, I would suggest taking a look at the footnotes extension. A preproccessor finds the footnotes and stores them on the the Markdown class instance, a inlinepattern creates the footnote links, and a postprocessor inserts the footnotes into the document. I expect you would do something similar. Except that in your case the inlinepattern would store the strings on the class instance and a treeprocessor would insert the new elements in the appropriate locations. At least that is the approach I would start with. Hope that helps and feel free to ask specific questions if you need to. Waylan Limberg > On May 19, 2016, at 10:32 AM, Daniel Miller <dm...@am...> wrote: > > I'm new to both Python and Python-Markdown - so if I express myself poorly I apologize. > > I asked a previous question - which was probably the wrong one. So I'll try this way. Given some Markdown source, where a delimited string appears, I want to strip those delimiters and leave the text exactly where it is - AND create a new <span> element that should be inserted into the tree before the enclosing paragraph. Looking at examples for inlinepatterns I don't see how to do that. > > -- > Daniel > ------------------------------------------------------------------------------ > Mobile security can be enabling, not merely restricting. Employees who > bring their own devices (BYOD) to work are irked by the imposition of MDM > restrictions. Mobile Device Manager Plus allows you to control only the > apps on BYO-devices by containerizing them, leaving personal data untouched! > https://ad.doubleclick.net/ddm/clk/304595813;131938128;j > _______________________________________________ > Python-markdown-discuss mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/python-markdown-discuss |