abdelouahabb / django-brackets

This is a simple extension to add syntaxe highlighter for Django templates to Brackets
10 stars 5 forks source link

Template text sometimes get hidden when pasting code from a website page #4

Open mmayla opened 9 years ago

mmayla commented 9 years ago

I pasted this code from django official documentation site https://docs.djangoproject.com/en/1.8/topics/auth/default/#all-authentication-views

{% if form.errors %}
<p>Your username and password didn't match. Please try again.</p>
{% endif %}

{% if next %}
    {% if user.is_authenticated %}
    <p>Your account doesn't have access to this page. To proceed,
    please login with an account that has access.</p>
    {% else %}
    <p>Please login to see this page.</p>
    {% endif %}
{% endif %}

<form method="post" action="{% url 'django.contrib.auth.views.login' %}">
{% csrf_token %}
<table>
<tr>
    <td>{{ form.username.label_tag }}</td>
    <td>{{ form.username }}</td>
</tr>
<tr>
    <td>{{ form.password.label_tag }}</td>
    <td>{{ form.password }}</td>
</tr>
</table>

<input type="submit" value="login" />
<input type="hidden" name="next" value="{{ next }}" />
</form>

{# Assumes you setup the password_reset view in your URLconf #}
<p><a href="{% url 'password_reset' %}">Lost password?</a></p>

after that the text didn't show and brackets ui freezes.

force quiting and factory reset brackets didn't work, the only solution was changing the file type from django to html

This problem seems to happen with some text and not for the other, and I don't know why.

mmayla commented 9 years ago

I thought this issue get produced from some hidden characters in the copied text but after some experiments to the problem, I figured out that this issue happen after writing any comment i.e.

{# my comment #}
abdelouahabb commented 9 years ago

Hi, Brackets uses codemirror, I just tried it, and it seems that the bug exist, what the extension do, is just activating the option that already exists, try the same code here, and you will see that it disapears too, please open an issue there https://codemirror.net/mode/django/index.html here is the repo https://github.com/codemirror/codemirror