lepture/mistune — pull request #4 by gholt (2014-03-02 06:41:55+00:00)
Title: Provide context for renderer

Great work on this; it is indeed fast!

Would you consider a change something like the prototype in this pull request? It provides the inline_lexer to the renderer method and sets a couple extra values that can be used for more advanced rendering.

Of course, a full implementation would change all the renderer methods to accept the lexer as an argument and would be breaking backwards compatibility, but it is a very new project so maybe it is in time? If so, I'm willing to make the change and submit it.

In the exact example usage I'm thinking of, I detect if an image is all alone or surrounded by other elements. Depending on its surroundings or lack thereof, I change the rendered CSS class. So for example, an image followed by text all in one paragraph might float the image left and flow the text around it.

Maybe an image would better explain:

![sample](https://f.cloud.github.com/assets/611567/2303624/9f1c31f2-a1d5-11e3-8122-e66e65d36489.jpg)