Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markdown Link is Incompatible with Blessed #57

Open
tonywei92 opened this issue Oct 1, 2019 · 4 comments
Open

Markdown Link is Incompatible with Blessed #57

tonywei92 opened this issue Oct 1, 2019 · 4 comments

Comments

@tonywei92
Copy link

tonywei92 commented Oct 1, 2019

markdown

- **[pica](https://nodeca.github.io/pica/demo/)** - high quality and fast image
  resize in browser.

output:

]8;;https://nodeca.github.io/pica/demo/pica]8;; - high quality and fast image

expected output:

code:

const blessed = require("blessed");
const marked = require("marked");
const TerminalRenderer = require("marked-terminal");

marked.setOptions({
      // Define custom renderer
      renderer: new TerminalRenderer()
    });

var screen = blessed.screen({
      smartCSR: true
    });

const markdown = blessed.box({
      top: 0,
      left: 0,
      width: "100%",
      height: "95%",
      border: {
        type: "line"
      },
      style: {
        fg: "white",
        bg: "black",
        border: {
          // fg: "#f0f0f0"
        },
        hover: {
          // bg: "green"
        }
      }
    });

markdown.setContent(
      marked(`- **[pica](https://nodeca.github.io/pica/demo/)** - high quality and fast image
    resize in browser.`)
    );

screen.append(markdown);

screen.render();

    screen.key(["escape", "q", "C-c"], function(ch, key) {
      return process.exit(0);
    });

please help

UPDATE, found the issue:

this is parsed markdown file from 1.5.0, with EXPECTED OUTPUT

�[0m
    * �[1m�[34mpica (�[34m�[4mhttps://nodeca.github.io/pica/demo/�[24m�[34m)�[39m�[22m - high quality and fast image
     resize in browser.�[0m

and this is from 3.3.0 with UNEXPECTED OUTPUT:

    * �[0m�[1m�[34m�]8;;https://nodeca.github.io/pica/demo/��[34m�[4mpica�[24m�[34m�]8;;��[39m�[22m - high quality and fast image�[0m
      �[0m  resize in browser.�[0m


@isamrish
Copy link

isamrish commented Oct 1, 2019

@tonywei92 -- I like to do it, please assign me.

@mikaelbr
Copy link
Owner

mikaelbr commented Oct 1, 2019

Great, @isamrish. I've assigned you now. Please let me know if there's questions you have. I would start by just setting up locally and investigating/testing out the code. Run the examples and the test and see how it works.

@isamrish
Copy link

isamrish commented Oct 4, 2019

@mikaelbr @tonywei92 -- I tried above code and I got this output. I am using PowerShell on windows

blessed-example

You can see my code here
https://github.com/IsAmrish/blessed-example

please let me know, how can I reproduce the above error?

@ajboni
Copy link

ajboni commented Aug 3, 2020

I can reproduce the error doing the same steps @tonywei92 described above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants