revolunet / sublimetext-markdown-preview

markdown preview and build plugin for sublime text 2/3
MIT License
2.31k stars 362 forks source link

Sublime text freezes when oppening revealJS README.md #114

Closed jorgeartware closed 11 years ago

jorgeartware commented 11 years ago

Can't attach images because I had to kill the process using the system monitor. But I tested it more than a few times and I had to roll back to regular markdown syntax highlight in order to be able to read that file.

check it out for yourself: https://github.com/hakimel/reveal.js

xpol commented 11 years ago

I have tried, the github parser will thow http.client.BadStatusLine:

Traceback (most recent call last):
  File "MarkdownPreview in <....>\Installed Packages\Markdown Preview.sublime-package", line 254, in convert_markdown
  File "X/urllib/request.py", line 160, in urlopen
  File "X/urllib/request.py", line 473, in open
  File "X/urllib/request.py", line 491, in _open
  File "X/urllib/request.py", line 451, in _call_chain
  File "X/urllib/request.py", line 1287, in https_open
  File "X/urllib/request.py", line 1257, in do_open
  File "X/http/client.py", line 1131, in getresponse
  File "X/http/client.py", line 354, in begin
  File "X/http/client.py", line 324, in _read_status
http.client.BadStatusLine: ''

And the markdown2 ("default") parser will not render correctly, have some thing like md5-5515ea8662861c0b505b35f9e954f312 in the code blocks, just as #76.

Only the newly added python-makdown parser works fine and quickly. Just config your parser: "parser":"markdown".

xpol commented 11 years ago

@revolunet I have found 2 things about this:

  1. revealJS README.md and our current cheat sheet markdown file would fail with github API, But if i reduce the 2 markdown file size, it would OK. That is small markdown files are OK.
  2. ST2 would handle the revealJS README.md and cheat sheet markdown file using github API correctly.

The bug reproduce steps:

  1. In ST3 (ST3 have urllib while ST2 use urllib2)
  2. with a large markdown file (Such as the cheatsheet markdown)
  3. Preview with github API
  4. We got http.client.BadStatusLine (seems the server returns nothing)

Would help check what's wrong with the ST3 code for using github API?

revolunet commented 11 years ago

ok i'll handle this one :)

xpol commented 11 years ago

BTW, I have asked for help at stackoverflow.com here but currently no answer yet.

revolunet commented 11 years ago

for some reason the GFM conversion make ST2 freeze, even with a single like markdown. Here's the line that cause the issue : json.dumps. https://github.com/revolunet/sublimetext-markdown-preview/blob/master/MarkdownPreview.py#L291

The data look correct though

revolunet commented 11 years ago

ok for some reason its workin again :)

revolunet commented 11 years ago

cannot reproduce, works fine on ST2/3