mikaelbr/marked-terminal

Escaped symbols are not shown correctly inside table with code cell

Closed this issue · 3 comments

Hi,
First of all - great work guys. I'm not sure if this issue is for marked-terminal, but let me explain it in details. In a table cell I'm using code, which contains < and > symbols. When they are rendered on the console, the table is shown correctly, but the < and > are shown as &lt; and &gt;
Here's the test scenario:

var markdownText = "Usage | Syntax" + "\r\n" + 
"------|-------" + "\r\n" +
"General |`$ shell <CommandParam>`";

var marked = require("marked");
var TerminalRenderer = require('marked-terminal');

var options = {
                unescape: true,
                tableOptions: { colWidths: [20,50] }
            };
marked.setOptions({ renderer: new TerminalRenderer(options) });
console.log(marked(markdownText));

marked-console-output

I've tried using unescape option, but it doesn't seem to help. If I render the code outside of the table, everything works as expected. Do you have an idea what's going wrong here?

Hi,
Do you have any idea what's causing this issue, can you take a look at it?

Sorry for the late response. I pushed a fix now. If you verify the fix I'll do a minor release to NPM.

@mikaelbr , awesome!!!
I've just tested the latest master branch and it is working like a charm!
Thank you very much!!! 😹