instant-markdown / vim-instant-markdown

Instant Markdown previews from Vim
https://instant-markdown.github.io
Other
2.73k stars 253 forks source link

macosx: only white page in browser #59

Closed seebi closed 3 years ago

seebi commented 10 years ago

after loading a markdown file, a new browser tab opens but only a white page is seen (with the following source):

<html>
<head>
  <meta charset="utf-8">
  <link rel="stylesheet" type="text/css" href="/node_modules/docter/ghf_marked.css" />
  <script src="/socket.io/socket.io.js"></script>
  <script>
    var socket = io.connect('http://localhost:8090/');
    socket.on('connect', function () {
      socket.on('newContent', function(newHTML) {
        document.body.innerHTML = newHTML;
      });
      socket.on('die', function(newHTML) {
        window.open('', '_self', '');
        window.close();

        var firefoxWarning =
        "<h1>Oops!</h1>" +
        "<h3>Firefox doesn't allow windows to self-close.</h3>" +
        "<h3>If you want the preview window to close automatically like in other browsers, go to about:config and set dom.allow_scripts_to_close_windows to true.</h3>"
        document.body.innerHTML = firefoxWarning;
      });
    });
  </script>
</head>
<body>
</body>
</html>
filipstachura commented 10 years ago

Same for me under Ubuntu 14.04.

node module is installed globally and works fine with curl from terminal (I use nvm) gems installed without sudo (I use rvm)

Not sure what's the problem but it might be connected.

rdok commented 10 years ago

+1.
OS: Ubuntu 14.04.1 LTS
Browsers: Firefox, Chrome

egel commented 10 years ago

+1 for Ubuntu 14.04.1 LTS, Chrome

egel commented 10 years ago

I fixed this issue on my Ubuntu 14.04.1 LTS with Chome browser:

  1. Instaling libraries:

    $ sudo apt-get install ruby1.9.3 xdg-utils python-software-properties
  2. Instaling latest nodejs and npm from Chris ppa:

    $ sudo apt-add-repository ppa:chris-lea/node.js && sudo apt-get update &&
     sudo apt-get install nodejs
  3. Third step is instaling obligatory gems, instant-markdown-d and also update permissions to .npm catalog:

    $ sudo gem install redcarpet pygments.rb &&
     sudo npm -g install instant-markdown-d &&
     sudo chown -R `whoami` ~/.npm
  4. Use Pathogen to take care of this repo:

    $ cd ~/.vim/bundle/ && git clone git@github.com:suan/vim-instant-markdown.git
  5. Finally add necessary settings to your .vimrc:

    filetype plugin indent on

    Or if you also use vim-markdown plugin then do not forget to add:

    " Force setting for *.md files. More info: https://github.com/tpope/vim-markdown
    autocmd BufNewFile,BufReadPost *.md set filetype=markdown

If still have blank page, check three times that you have installed all obligatory softwar - that was my mistake.

Hope this helps :smiley:

egel commented 10 years ago

Look at this issue https://github.com/suan/vim-instant-markdown/issues/60 that I've started. It could be the main (or partly) cause of this problem.

suan commented 9 years ago

I've tried using the plugin on a Ubuntu 14.04 VM (full-fledged one, with Unity and all) and it seems to work fine. My steps were roughly:

Unfortunately right now there are a lot of steps for installation but just make sure you've done each of them.

rdok commented 9 years ago

@suan perfect fix on the previously failed Ubuntu 14.04
Yes they may be a lot of steps, but they didn't more than 5 minutes to run them.
Thank you very much!!

basvandenberg commented 9 years ago

For Ubuntu 14.10 this solved the issue for me as well. Small modification though, the third step should probably be:

without the space beteen red carpet.

simonweil commented 9 years ago

Doesn't work for me either, tried all the above tricks.

OS: MAC OSX Yosemite (10.10.2) Browser: Firefox

xanderdunn commented 9 years ago

@egel 's steps seem to have solved it for Ubuntu users, but not for Mac users. I'm also having this problem. Always nothing but a white page showing up in the browser.

shenxs commented 9 years ago

@suan Thank you !! It works on ubuntu 14.04 LTS chrome

xanderdunn commented 9 years ago

shime/livedown worked for me on OSX without any configuration or difficulties.

robbie-cao commented 9 years ago

I have the issue browsing with Chrome, but Firefox works fine. MacOS El Captain.

tukoz commented 8 years ago

@basvandenberg's comment:

sudo gem install pygments.rb redcarpet

without the space beteen red carpet. Works for Arch linux.

Also just in case it needs Javascript ON in the $BROWSER.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.