neutronX / django-markdownx

Comprehensive Markdown plugin built for Django
https://neutronx.github.io/django-markdownx/
Other
863 stars 153 forks source link

can be put preview element outside div.markdownx #157

Closed naritotakizawa closed 5 years ago

naritotakizawa commented 5 years ago

I needed to put div.markdownx-preview outside div.markdownx, so forked and added this functionality.

widget2.html(override)

<div class="markdownx" dataset-preview=".markdownx-preview">
    {% include 'django/forms/widgets/textarea.html' %}
</div>

somewhere

<div class="tabs">
    <div class="tab1">
        <form method="POST" action="">{% csrf_token %}
            {{ markdownx_form }}
            ...
            ...
        </form>
    </div>
    <div class="tab2">
        <div class="markdownx-preview"></div>
    </div>
</div>