Comments (13)
Ok, I'm getting this behavior on macOS Mojave as well now, I'll look into it.
from mdless.
Ok, v0.0.14 should solve most problems, please try it out and let me know.
from mdless.
I'm getting the following stack trace as well whenever the markdown has a code block. It works fine as long as there's no code.
I'm also using mdless 0.0.12 but a standard Ubuntu shell.
Traceback (most recent call last):
8: from /usr/local/bin/mdless:23:in `<main>'
7: from /usr/local/bin/mdless:23:in `load'
6: from /var/lib/gems/2.5.0/gems/mdless-0.0.12/bin/mdless:17:in `<top (required)>'
5: from /var/lib/gems/2.5.0/gems/mdless-0.0.12/bin/mdless:17:in `new'
4: from /var/lib/gems/2.5.0/gems/mdless-0.0.12/lib/mdless/converter.rb:133:in `initialize'
3: from /var/lib/gems/2.5.0/gems/mdless-0.0.12/lib/mdless/converter.rb:437:in `convert_markdown'
2: from /var/lib/gems/2.5.0/gems/mdless-0.0.12/lib/mdless/converter.rb:437:in `gsub!'
1: from /var/lib/gems/2.5.0/gems/mdless-0.0.12/lib/mdless/converter.rb:457:in `block in convert_markdown'
/var/lib/gems/2.5.0/gems/mdless-0.0.12/lib/mdless/converter.rb:324:in `hiliteCode': undefined method `split' for nil:NilClass (NoMethodError)
from mdless.
from mdless.
I'm using OSX also
from mdless.
Same problem here on Linux Mint 19.1 (based on Ubuntu 18.04).
from mdless.
I have the same issue, Ubuntu 18.04 -
- ruby 2.5.1p57 (installed from ubuntu repositories)
- mdless 0.0.12
I don't see any errors or useful messages when running with -d4
I tried installing pygmentize, but the behavior was unchanged. Please let me know if there's something I can do to help debug this issue!
from mdless.
Ok, pushed gem for 0.0.13, and source is updated in code and releases page. Give it a whirl and let me know if it doesn't solve the issue for you.
from mdless.
Seems to have fixed the missing code issue! Thanks!
There's some other weirdness in my output which confuses me...
It looks like slightly malformed markdown mdless doesn't like: https://github.com/vector-im/riot-web/blob/develop/README.md#setting-up-a-dev-environment - the first section has"``` bash" as the opening of the codeblock (note the space between the triple backtick and "bash"), which mdless
emits as:
--[ ]--------------------------------------------------------------------------------------------
--[ END ]----------------------------------------------------------------------------------------
It also looks like bare codeblocks with no type hints get garbled: https://github.com/espressif/esp-idf/blob/master/examples/protocols/sockets/tcp_client/README.md#tcp-server-using-netcat
Renders like this for me:
--[ CODE ]--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[0;30m~ [0;37;40m nc[0;37;40m -l[0;37;40m 192.168.0.167[0;37;40m -p[0;37;40m 3333[0;37;40m [0;37m
--[ END CODE ]----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Despite the broken escape sequences, some of the escaped output is being consumed. If I run mdless README.md -P | less -R
you can see some of the escape sequences are being consumed but not others:
--[ CODE ]--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[39;49;00m[0;30m~ [39;49;00m[0;37;40m nc[39;49;00m[0;37;40m -l[39;49;00m[0;37;40m 192.168.0.167[39;49;00m[0;37;40m -p[39;49;00m[0;37;40m 3333[39;49;00m[0;37;40m [39;49;00m[0;37m
--[ END CODE ]----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Adding in bash
gives nicely rendered output:
--[ BASH ]--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
nc -l 192.168.0.167 -p 3333
--[ END BASH ]----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
It is colorized in some code blocks when there's no type hint, but interspersed with garbled escape sequences. I don't know what the extra escape sequences in the bare version come from.
I can pop these open as separate issues if you would prefer. Thanks again for the help!
from mdless.
from mdless.
Confirmed that .14 fixed it for me.
Thanks for the update! <3
I had started using the MarkdownPreview vim extension but I much prefer being able to view it directly in the terminal!
from mdless.
Thanks for the prompt updates! 0.14 seems to have resolved all the issues for me. The only remaining oddity is a character indicating a newline which appears in codeblocks with no type, but that's not really an issue.
from mdless.
That ¬ character is intentional. I found that with the way I changed some of the highlighting, it was helpful to see where wrapped lines actually ended. I plan to make it customizable/optional in an upcoming release.
from mdless.
Related Issues (20)
- Problem with codeblocks following lists HOT 9
- math equations ($$) HOT 3
- how to set image width and height HOT 7
- `GIT_PAGER=mdless git log` hangs HOT 3
- Request support for Alactritty Terminal Emulator HOT 2
- How to use built-in pager? HOT 4
- Display multiple sections with '-s' HOT 7
- Rendering headers & paragraphs HOT 2
- In contrast to less: mdless doesn't adapt to changing view port of terminal HOT 21
- Code Block rendering shows additional newlines if code block is indented too much HOT 2
- Snap install trying to access '/etc/gitconfig' HOT 7
- 2.0.3 build issue HOT 2
- Table inherit its size from previous table in the file HOT 4
- Not compatible with watch HOT 2
- Strange behaviour when opening in a "small terminal" HOT 4
- Is v2.1.3 the latest release? HOT 6
- empty character in codeblock doesn't work anymore HOT 11
- Ubuntu 20.04, Ruby 2.7.0p0, mdless 2.1.28 gem - syntax error in `string.rb` HOT 4
- Error in convertor.rb HOT 2
- 404 error from gem file on "rake install" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mdless.