Closed eriktelepovsky closed 6 years ago
You debugged an intertwined, compiled JavaScript file. The Request
class is fine - I wrote it 2 or 3 years ago, and I have since used it in many, many projects. If there is a problem, it's not there; at least not in that method.
Any idea where should I look elsewhere? The interesting fact is, the preview works in the Django admin but not on the frontend. But I can see the requests are being fired and the HTTP responses have correct content.
You have edited the wrong file. That file will be overwritten the moment someone recompiles the TypeScript file, which is the source code for the part of the API that is written in JavaScript .
That said, I am still unclear what your problem is. Give me a proper outline in the following order:
Here is the Request class, and here is the part you edited. It does nothing, until it is assigned to something.
What you need to do is to find out where the potential problem lies in markdownx.ts file.
Yes, I understand it will be overwritten, I just wanted to point to the issue. I think it will be easier to demonstrate using screen recording. Please look into my video I just uploaded:
Btw. I haven't edited the part you pointed to, I edited the compiled output of this part:
https://github.com/neutronX/django-markdownx/blob/master/static-src/markdownx/js/markdownx.ts#L703
I can't figure out why the original code doesn't work by default in my project.
Thank you.
The question is, why is it working in one place, but not the other! Any terminal outputs?
Nothing suspicious in output :/ My guess is a conflict with some other JavaScript library I use in my project on the frontend, because your testapp works fine for me. I'll investigate it.
Any updates?
No additional info... closing.
Hi.
I have successfully configured markdown field and it works fine in the admin:
I also use it in my custom form on frontend, but unfortunately, the preview does not work. I can see the requests in the "Network" tab in the Google Chrome Developer Tools and I see the response is correctly returned:
I debugged markdown.js file at line 477:
and the result is, that "response" variable is always null:
Any idea what can cause the issue?
pip: