nea / MarkdownViewerPlusPlus

A Notepad++ Plugin to view a Markdown file rendered on-the-fly
MIT License
1.17k stars 143 forks source link

CSS color is not rendered #32

Open JunjieW opened 7 years ago

JunjieW commented 7 years ago

Hi,

I was trying to add some customized CSS, but it wasn't rendered well. I'm not sure if it's caused by the HTMLRenderer or in this plugin. The exported html can be rendered as expected in Chrome, IE, Firefox.

body {
    font-family: "Source Sans Pro",sans-serif;
    font-size: 13px;
    color: #3f3f3f
}
h1 {    font-size: 25px; }
h2 {    font-size: 23px; }
h3 {    font-size: 21px; }
h4 {    font-size: 19px; }
h5 {    font-size: 16px; }
h1, h2, h3, h4, h5, h6 {
    font-family: inherit;
} 
blockquote {
  background: #f9f9f9;
  border-left: 10px solid #ccc;
  padding-top: 5px;
  padding-bottom: 5px;
  quotes: "\201C""\201D""\2018""\2019";
}

code {
    font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
    font-size: 95%;
    white-space: pre;
    white-space: pre-wrap;
    white-space: -moz-pre-wrap;
    white-space: -o-pre-wrap;
    background: rgb(200,200,200);
    display: inline-block;
}
pre code {
    font-family: Monaco, Consolas, "Andale Mono", "DejaVu Sans Mono", monospace;
    font-size: 95%;
    line-height: 140%;
    white-space: pre;
    white-space: pre-wrap;
    white-space: -moz-pre-wrap;
    white-space: -o-pre-wrap;
    background: #faf8f0;
    display: block;
    padding: 0.5em 1em;
    border: 1px solid #bebab0;
}
JunjieW commented 7 years ago

BTW there is another html rendering solution provided by this repo,

I was trying to improve that plugin then found yours, while that one renders HTML without problem since it is using IE core, it doesn't provide functionality for HTML and PDF export, which is a very useful for me : ) ...

JunjieW commented 7 years ago

Hmm, actually it works for CSS property background-color but not background

nea commented 7 years ago

Hey @JunjieW

Thanks for the example.

Yeah, I just the IE import originally but wanted to keep everything contained with as little external dependencies as possible, why I changed to the HTML Renderer. It is not the most active development but a very good basic library.

But because of that, many things are probably just not implemented in the lib. I will check on the source and see why background-color works but not background and maybe I can create a pull-request.

Cheers