Skip to content

Commit 76c4877

Browse files
committed
Enable HTML validation in CI
Fix invalid or outdated HTML
1 parent c4257c4 commit 76c4877

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+823
-732
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build
1+
name: Build, Validate, Package & Publish
22

33
on: [push, pull_request, workflow_dispatch]
44

@@ -82,3 +82,20 @@ jobs:
8282
foreach ($file in (Get-ChildItem ${{ env.NuGetDirectory }} -Recurse -Include *.*nupkg)) {
8383
dotnet nuget push $file --skip-duplicate --api-key ${{steps.login.outputs.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json
8484
}
85+
86+
validate:
87+
name: Validate HTML and CSS
88+
runs-on: ubuntu-24.04
89+
steps:
90+
- name: Checkout HTML Renderer
91+
uses: actions/checkout@v6
92+
93+
- name: Validate HTML
94+
uses: anishathalye/proof-html@v2
95+
with:
96+
directory: ./Source
97+
check_html: true
98+
check_css: true
99+
check_favicon: false
100+
check_opengraph: false
101+
validator_ignore: '.*Use CSS instead.*|.*An “img” element must have an “alt” attribute.*|.*abcdef-data.*|.*“&” did not start a character reference.*'

Source/Demo/Common/PerfSamples/1.Big table.htm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
1+
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title></title>
4+
<title>Big table</title>
55
<style type="text/css">
66
* {
77
margin: 0;
@@ -3082,6 +3082,5 @@ <h2 style="color: #666666; margin: 0 0 0 0; font-weight: normal; font-size: 24px
30823082
</tr>
30833083
</tbody>
30843084
</table>
3085-
</div>
30863085
</body>
30873086
</html>

Source/Demo/Common/Samples/00.Intro.htm

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,38 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<title>Intro</title>
4-
<link rel="Stylesheet" href="StyleSheet" />
5+
<link rel="Stylesheet" href="StyleSheet">
56
</head>
67
<body style="background-color: #333; background-gradient: #707; background-gradient-angle: 60; margin: 0;">
78
<h1 align="center" style="color: white">
89
HTML Renderer Project - $$Platform$$
9-
<br />
10+
<br>
1011
<span style="font-size: x-small;">Release $$Release$$</span>
1112
</h1>
1213
<blockquote class="whitehole">
13-
<p style="margin-top: 0px">
14-
<table border="0" width="100%">
15-
<tr style="vertical-align: top;">
16-
<td width="32" style="padding: 2px 5px 0 0">
17-
<img src="HtmlIcon" />
18-
</td>
19-
<td>
20-
Everything you see on this panel (see samples on the left) is <b>custom-painted</b>
21-
by the <b>HTML Renderer</b>, including tables, images, links and videos.<br />
22-
This project allows you to have the rich format power of HTML on your desktop applications
23-
without <b>WebBrowser</b> control or <b>MSHTML</b>.<br />
24-
The library is <b>100% managed code</b> without any external dependencies, the only
25-
requirement is <b>.NET Framework 4.6.2 or higher</b>, including support for Client Profile.
26-
</td>
27-
</tr>
28-
</table>
29-
</p>
14+
<table border="0" width="100%" style="margin-top: 0px">
15+
<tr style="vertical-align: top;">
16+
<td width="32" style="padding: 2px 5px 0 0">
17+
<img src="HtmlIcon" />
18+
</td>
19+
<td>
20+
Everything you see on this panel (see samples on the left) is <b>custom-painted</b>
21+
by the <b>HTML Renderer</b>, including tables, images, links and videos.<br>
22+
This project allows you to have the rich format power of HTML on your desktop applications
23+
without <b>WebBrowser</b> control or <b>MSHTML</b>.<br>
24+
The library is <b>100% managed code</b> without any external dependencies, the only
25+
requirement is <b>.NET Framework 4.6.2 or higher</b>, including support for Client Profile.
26+
</td>
27+
</tr>
28+
</table>
3029
<h3>
3130
Text selection (copy to clipboard)
3231
</h3>
3332
<div>
3433
The rendered html has full support for <b>text selection</b> including <b>drag-and-drop</b>
3534
and <b>copy</b> to clipboard of rich html and plain text to handle <b>paste</b>
36-
operation to editor that support rich or/and plain text.<br />
35+
operation to editor that support rich or/and plain text.<br>
3736
Additionally there is a <b>context-menu</b> with select all, copy text, copy image,
3837
save image, open link, copy link url, open video, copy video url.
3938
</div>
@@ -42,7 +41,7 @@ <h3>
4241
</h3>
4342
<div>
4443
The core layout engine of the renderer was builded according to <b>CSS Level 2 specification</b>,
45-
so you can use Cascading Style Sheets to format your html documents.<br />
44+
so you can use Cascading Style Sheets to format your html documents.<br>
4645
Additionally there are a couple extensions: <b>Gradients</b> on backgrounds and
4746
<b>rounded corners</b>.
4847
</div>
@@ -75,7 +74,7 @@ <h3>
7574
<li>All HTML <b>end tags</b> marked as <a href="http://www.w3.org/TR/1999/REC-html401-19991224/index/elements.html">
7675
optional</a> should be there. No problem with tags marked as forbidden.</li>
7776
</ul>
78-
<hr />
77+
<hr>
7978
<h3>
8079
On the roadmap</h3>
8180
Of course it's not quite finished yet. Here are some of the important things to
@@ -98,7 +97,7 @@ <h3>
9897
<li>Most complete static HTML Renderer (no java script).</li>
9998
<li>Commercial web browser performance level.</li>
10099
</ul>
101-
<hr />
100+
<hr>
102101
<h3>
103102
2012 - Arthur Teplitzki
104103
</h3>

Source/Demo/Common/Samples/01.History.htm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
3-
<link rel="Stylesheet" href="StyleSheet" />
4+
<title>History</title>
5+
<link rel="Stylesheet" href="StyleSheet">
46
</head>
57
<body>
68
<h1>
@@ -29,7 +31,7 @@ <h1>
2931
all of the code on the library is managed code and the methods it use to paint are
3032
quite basic. It draws lines, rectangles, curves and text.
3133
</p>
32-
<hr />
34+
<hr>
3335
<p>
3436
In October 2012 I <i>(Arthur)</i> was looking to replace the usage of WinForms WebBrowser
3537
control by something that can render complex html and have good performance and stability

Source/Demo/Common/Samples/02.Text.htm

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
<html>
1+
<!DOCTYPE html>
2+
<html>
23
<head>
34
<title>Text</title>
4-
<link rel="Stylesheet" href="StyleSheet" />
5+
<link rel="Stylesheet" href="StyleSheet">
56
<style type="text/css">
67
::selection {
78
color: #bb5555;
@@ -36,13 +37,13 @@ <h2>Formatting
3637
<span style="text-decoration: line-through">dignissim ac, iaculis eget</span>, elit.
3738
Donec arcu.
3839
</p>
39-
<hr />
40+
<hr>
4041
<h2>Custom fonts
4142
</h2>
4243
<p style="font: 20px '1 Smoothy DNA'">
4344
This is a custom font that is not installed on the system.
4445
</p>
45-
<hr />
46+
<hr>
4647
<h2>Alignment
4748
</h2>
4849
<p>
@@ -78,15 +79,15 @@ <h3>Justifed</h3>
7879
libero. Donec lacus. Nam sit amet urna. Nullam nulla. Donec accumsan porta magna.
7980
Mauris a dolor eu elit rutrum commodo. Nam iaculis turpis non augue.
8081
</p>
81-
<hr />
82+
<hr>
8283
<h2>Breakable lines</h2>
8384
<span style="word-break: break-all;">https://www.google.com/sjkdhgfasdfgfg/asdfadfsgaefg/adfgafdgadfg/asdfgaedfgsdfg/dasfgasfdgasdfg/adfgadfgasfdg/adfsgafgafg/afdgaddfgadfg/afsdgafdgaddfg/afsdgafgadqfdgaeddfg</span>
84-
<hr />
85+
<hr>
8586
<h2>Transparent text</h2>
8687
<p style="background-image: url('ImageIcon')">
8788
<span style="font-size: 2.5em; font-weight: bold; color: rgba(0, 0, 0, 100); padding: 0 10px">Lorem ipsum dolor sit amet, consectetur adipiscing elit</span>
8889
</p>
89-
<hr />
90+
<hr>
9091
<h2>Preformatted text</h2>
9192
<p>
9293
The preformatted text is fully supported, like this C# code demo:
@@ -100,8 +101,8 @@ <h2>Preformatted text</h2>
100101
<span style="color: #099">MessageBox</span>.Show(<span color="maroon">"Hello World"</span>);
101102
}
102103
}</pre>
103-
<br />
104-
<hr />
104+
<br>
105+
<hr>
105106
<h2>Lists</h2>
106107
<p>
107108
Both UL and OL tags are supported, though, all the CSS properties related with lists
@@ -116,10 +117,12 @@ <h3>Unordered list
116117
<ul>
117118
<li>Sub item one</li>
118119
<li>Sub item two</li>
119-
<ul>
120-
<li>Sub-sub item two</li>
121-
<li>Sub-sub item two</li>
122-
</ul>
120+
<li>
121+
<ul>
122+
<li>Sub-sub item two</li>
123+
<li>Sub-sub item two</li>
124+
</ul>
125+
</li>
123126
</ul>
124127
</li>
125128
<li>Item three</li>
@@ -146,8 +149,8 @@ <h3>List nesting</h3>
146149
<li>Item four</li>
147150
<li>Item five</li>
148151
</ol>
149-
<br />
150-
<hr />
152+
<br>
153+
<hr>
151154
<h2>Right to left direction
152155
</h2>
153156
<p>

Source/Demo/Common/Samples/03.Tables.htm

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<title>Tables</title>
4-
<link rel="Stylesheet" href="StyleSheet" />
5+
<link rel="Stylesheet" href="StyleSheet">
56
<style type="text/css">
67
table, tr, th {
78
border-style: solid;
@@ -60,7 +61,7 @@ <h2>
6061
</td>
6162
</tr>
6263
</table>
63-
<br />
64+
<br>
6465
<div class="caption">
6566
Table with complex text and width=100%
6667
</div>
@@ -114,7 +115,7 @@ <h2>
114115
</td>
115116
</tr>
116117
</table>
117-
<br />
118+
<br>
118119
<div class="caption">
119120
Table with colspans:</div>
120121
<table>
@@ -146,7 +147,7 @@ <h2>
146147
</td>
147148
</tr>
148149
</table>
149-
<br />
150+
<br>
150151
<div class="caption">
151152
Table with rowspans:</div>
152153
<table>

Source/Demo/Common/Samples/04.Links.htm

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
<!DOCTYPE html>
12
<html>
23
<head>
34
<title>Links</title>
4-
<link rel="Stylesheet" href="StyleSheet" />
5+
<link rel="Stylesheet" href="StyleSheet">
56
</head>
67
<body>
78
<h1>Links
@@ -10,56 +11,56 @@ <h1>Links
1011
<p>
1112
HTML Renderer supports all html hyperlinks specification and code interception.
1213
</p>
14+
<h3>URI href</h3>
1315
<p>
14-
<h3>URI href</h3>
1516
Any valid URI path will activate the default internet browser.
16-
<br />
17+
<br>
1718
Check the context menu options on the link as well by right clicking on it.
18-
<br />
19+
<br>
1920
This is a URI link to <a href="https://codeplexarchive.org/project/HtmlRenderer">HTML Renderer</a> (<code>href="https://codeplexarchive.org/project/HtmlRenderer"</code>)
2021
</p>
22+
<h3>File path href</h3>
2123
<p>
22-
<h3>File path href</h3>
2324
Any file system path, It will be started as if you typed it on the <i>Run</i> Windows dialog.
24-
<br />
25-
This is a link to <a href="C:\">hard drive</a> <code>(href="C:\")</code>
25+
<br>
26+
This is a link to <a href="C:/">hard drive</a> <code>(href="C:/")</code>
2627
</p>
28+
<h3>Anchors href</h3>
2729
<p>
28-
<h3>Anchors href</h3>
2930
Link to elements on the page using element id will scroll to that element so it will be at the top.
30-
<br />
31+
<br>
3132
This is a link to <a href="#anchor">anchor</a> at the bottom of the page <code>(href="#anchor")</code>
3233
</p>
34+
<h3>Intercept</h3>
3335
<p>
34-
<h3>Intercept</h3>
3536
Any link click can be intercepted by <i>LinkClicked</i> event, analyzed by link 'href' value or
3637
other attributes of the link element and cancel the default processing those allowing custom handling.
37-
<br/>
38+
<br>
3839
This link is intercepted to show message box <a href="SayHello">Hello!</a> (<code>href="SayHello"</code>)
3940

4041
</p>
41-
<br/>
42-
<br/>
43-
<br/>
44-
<br/>
45-
<br/>
46-
<br/>
47-
<br/>
48-
<br/>
49-
<br/>
50-
<br/>
51-
<br/>
52-
<br/>
53-
<br/>
54-
<br/>
55-
<br/>
56-
<br/>
57-
<br/>
58-
<br/>
59-
<br/>
60-
<br/>
61-
<br/>
62-
<br/>
42+
<br>
43+
<br>
44+
<br>
45+
<br>
46+
<br>
47+
<br>
48+
<br>
49+
<br>
50+
<br>
51+
<br>
52+
<br>
53+
<br>
54+
<br>
55+
<br>
56+
<br>
57+
<br>
58+
<br>
59+
<br>
60+
<br>
61+
<br>
62+
<br>
63+
<br>
6364
<p id="anchor" style="color: gray">
6465
Anchor here
6566
</p>

0 commit comments

Comments
 (0)