miguelgrinberg / Flask-PageDown

Implementation of StackOverflow's "PageDown" markdown editor for Flask and Flask-WTF.
MIT License
244 stars 21 forks source link

How to render pic in the container? #10

Closed Kopei closed 5 years ago

Kopei commented 9 years ago

Hi, Miguel! I am your big fan with flask web design. I have test the Pagedown example, but how can I let the pic fit inside the field? Not like below. 2015-05-10 20 40 39

miguelgrinberg commented 9 years ago

This is strictly in the PageDown domain, so you will need to add something on the browser. PageDown supports hooks, or else you can also add CSS rules to keep images from going over the width of your preview area.

linanwx commented 7 years ago

Hi, I am a beginner. I found a way to make the picture normal. The method is very simple. This consists of two steps. First note the pagedown script. Then use showdown instead of pagedown script. After that, in the document, you can use more labels. You can use it like this. <Img src = "yourpicture.png" width = "80%" /> It will show in normal.

linanwx commented 7 years ago

This is how I do it.

{% block scripts %}
    {{ super() }}
    {# pagedown.include_pagedown() #}
    <script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.6.4/showdown.min.js"></script>
    <script type="text/javascript">
        var converter = new showdown.Converter();
        function flask_pagedown_converter(text){
            return converter.makeHtml(text);
        } 
    </script>
{% endblock %}
miguelgrinberg commented 5 years ago

This issue will be automatically closed due to being inactive for more than six months. Seeing that I haven't responded to your last comment, it is quite possible that I have dropped the ball on this issue and I apologize about that. If that is the case, do not take the closing of the issue personally as it is an automated process doing it, just reopen it and I'll get back to you.