nea / MarkdownViewerPlusPlus

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

[Bug Report] Table Body Background Color Not Render #83

Open frank-mi-usa opened 6 years ago

frank-mi-usa commented 6 years ago

Table Body Background Color Not Render

The markdown viewer doesn't render table background color, so I can't set even and odd rows with different background colors.

If I apply the Github Style Markdown CSS, the comparison result is shown below. The left one is the expected table which is the same markdown file exported as html. The right one is what is shown in the markdown viewer. Notice that even number rows has a different color:

capture3

To make it more clear, I use the following CSS, and then the comparison result is following. the Left is the same table exported as html, and the Right is what is shown in the markdown viewer:

table {border-collapse: collapse;
    width: 100%;
    border-radius: .8em;
    overflow: hidden;}
th, td {text-align: left;
    padding: 8px;}
tr:nth-child(odd){background-color: #abcdef}
th {background-color: #4CAF50;
    color: white;}
td {color: purple;}

capture4

Environment

monoblaine commented 6 years ago

MarkdownViewer uses HTML-Renderer to render HTML code but it lacks support for some css features (:nth-child selector is probably one of them).

I have an experimental and a-little-buggy fork here:

https://github.com/monoblaine/MarkdownViewerPlusPlus/tree/0.8.1

I've ditched HTML-Renderer and used the new Microsoft Edge WebView component to render html. So it supports modern html and css features.

But,

frank-mi-usa commented 6 years ago

@monoblaine , thanks!