mgaitan / waliki

A wiki engine powered by Django and Git
http://waliki.pythonanywhere.com
BSD 3-Clause "New" or "Revised" License
309 stars 56 forks source link

Python code is not rendered correctly #125

Closed Muffo closed 7 years ago

Muffo commented 8 years ago

I am testing the demo of the Wiki and I have found an issue with pages containing Python code.

Text of the page

for i in range(3): print i

Result

``` for i in range(3):

System Message: WARNING/2 (<string> line 1) id2
Inline literal start-string without end-string.

System Message: ERROR/3 (<string> line 3)
Unexpected indentation.

print i
System Message: WARNING/2 (<string> line 4)
Block quote ends without a blank line; unexpected unindent.

System Message: WARNING/2 ( line 4) id4 Inline literal start-string without end-string.

System Message: WARNING/2 ( line 4) id6 Inline interpreted text or phrase reference start-string without end-string.



URL of the page http://waliki.pythonanywhere.com/newpage3/edit

See screenshot:
![screenshot_051316_122113_pm](https://cloud.githubusercontent.com/assets/538925/15246496/373aea0c-1905-11e6-8758-d3325a7e4fc1.jpg)
mgaitan commented 8 years ago

Hi @Muffo. I've tried the page you linked and I can't reproduce it, both in rst and md formats. The problem looks like the editor never knew you changed the default format (rst) to markdown, and it's rendering using the wrong processor for your markup. this is done via javascript, when you click in the dropdown.

which browser do you use? do you have javascript disabled, may be? Does it also happen to you editing a page that already exists?

Muffo commented 8 years ago

I am using the latest stable version of Chrome on Windows and after reloading the page it is working OK

I'll give you more details about what I did originally:

  1. Open the URL of a non existing page
  2. Create the page and add the markdown code
  3. Click on Preview using restructured text (do not selecting "Markdown")
  4. The error is displayed
  5. Go back to the Editor view
  6. Select Markdown and click again on Preview
  7. The error is still there

Hope this helps

mgaitan commented 8 years ago

ok, great report, I can reproduce it now . I'll see asap. thanks

Muffo commented 8 years ago

There's no hurry for the fix :)

I am glad this was useful!