문제

I'm having a problem here: i'm building out a simple blog, and I'm using markdown, pygments and django to do so.

My content is in markdown and I wish to code-highlight it. It works fine, except markdown, is not respecting the indentation of python code.

Here's a screenshot

borked indent

And here's a screenshot of the content in django admin:

borked indent 2

Also, the code for rendering in the template:

            <div class="row">
                <div class="span12 vertical-spacer">
                    {{ object.body|markdown:"safe,codehilite"|render_inlines|safe }}
                </div>
            </div>
도움이 되었습니까?

해결책

I had this problem ages ago when trying to use the Mingus blog app, which uses Markdown and pygments. The issue appears to stem from the use of the render_inlines filter, although I'm not entirely sure why. I wasn't using that particular functionality, so I removed it from the template.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top