simov / markdown-viewer

Markdown Viewer / Browser Extension
MIT License
1.05k stars 133 forks source link

Highlight `console` output #108

Closed stdedos closed 4 years ago

stdedos commented 4 years ago

From here https://stackoverflow.com/a/52586193/2309247

I am not sure who's "responsibility" is to update; so feel free to educate me.

Maybe those errors are related?

Access to XMLHttpRequest at 'file:///?preventCache=1581322597365' from origin 'null' has been blocked by CORS policy: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
GET file:/// net::ERR_FAILED
simov commented 4 years ago

Not sure what your issue exactly is, are you saying that the syntax highlighting isn't working for you?

Otherwise that error is something new in Chrome 80, just updated it yesterday, and I'm seeing it for the first time. So it seems auto reloading for local files won't work anymore unless I do something about it ..

stdedos commented 4 years ago

Try e.g. this:

```console
yu@hu:~$ echo hi
hi
yu@hu:~$ sudo apt install php libapache2-mod-php
yu@hu:~$ sudo systemctl restart apache2
yu@hu:~$ systemctl status php7.2-fpm
* php7.2-fpm.service - The PHP 7.2 FastCGI Process Manager
   Loaded: loaded (/lib/systemd/system/php7.2-fpm.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2018-06-30 23:56:14 PDT; 1min 28s ago
     Docs: man:php-fpm7.2(8)
 Main PID: 10080 (php-fpm7.2)
   Status: "Processes active: 0, idle: 2, Requests: 0, slow: 0, Traffic: 0req/sec"
    Tasks: 3 (limit: 2321)
   CGroup: /system.slice/php7.2-fpm.service
           |-10080 php-fpm: master process (/etc/php/7.2/fpm/php-fpm.conf)
yu@hu:~$ sudo systemctl restart nginx
yu@hu:~$ sudo apt install php-[extname]

on a local file. I think the colored output won't be the same. You would need to use e.g. bash to make it somewhat work:

```bash
yu@hu:~$ echo hi
hi
yu@hu:~$ sudo apt install php libapache2-mod-php
yu@hu:~$ sudo systemctl restart apache2
yu@hu:~$ systemctl status php7.2-fpm
* php7.2-fpm.service - The PHP 7.2 FastCGI Process Manager
   Loaded: loaded (/lib/systemd/system/php7.2-fpm.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2018-06-30 23:56:14 PDT; 1min 28s ago
     Docs: man:php-fpm7.2(8)
 Main PID: 10080 (php-fpm7.2)
   Status: "Processes active: 0, idle: 2, Requests: 0, slow: 0, Traffic: 0req/sec"
    Tasks: 3 (limit: 2321)
   CGroup: /system.slice/php7.2-fpm.service
           |-10080 php-fpm: master process (/etc/php/7.2/fpm/php-fpm.conf)
yu@hu:~$ sudo systemctl restart nginx
yu@hu:~$ sudo apt install php-[extname]

This is my output: image


Otherwise that error is something new in Chrome 80, just updated it yesterday, and I'm seeing it for the first time. So it seems auto reloading for local files won't work anymore unless I do something about it ..

Okay, sorry for piggy-backing. Create a new issue or "silently" fix it.

simov commented 4 years ago

This extension uses Prism for syntax highlighting, so unless the syntax you want is one of the Supported Languages, then no luck. And I can't find a console one.

stdedos commented 4 years ago

It is there: It's called "Shell Session" (opened a feature request here https://github.com/PrismJS/prism/issues/2207)

simov commented 4 years ago

Ok, I'm adding it in the next release .. have to fix the autoreload for local files anyway. Thanks for letting me know :+1:

simov commented 4 years ago

Published in v3.9, also the autoreload for file URLs was fixed as well.