File tree 3 files changed +29
-2
lines changed 3 files changed +29
-2
lines changed Original file line number Diff line number Diff line change 2
2
using System ;
3
3
using System . Collections . Generic ;
4
4
using System . Linq ;
5
+ using System . Security . Cryptography . X509Certificates ;
5
6
using System . Text ;
6
7
7
8
namespace NMyVision . HtmlParserTests
@@ -78,5 +79,29 @@ public void MultipleRunsTest()
78
79
Assert . IsTrue ( el . HasChildren ( ) ) ;
79
80
80
81
}
82
+
83
+ [ TestMethod ( ) ]
84
+ public void LargeHtml ( )
85
+ {
86
+ var html = @"<html lang=""en"">
87
+ <head>
88
+ <title>Pug</title>
89
+ <script type=""text/javascript""> if (foo) bar(1 + 5) </script>
90
+ </head>
91
+ <body>
92
+ <h1>Pug - node template engine</h1>
93
+ <div id=""container"" class=""col"">
94
+ <p>You are amazing</p>
95
+ <p>Pug is a terse and simple templating language.</p>
96
+ </div>
97
+ </body>
98
+ </html>" ;
99
+
100
+ var el = new HtmlParser ( ) . Parse ( html ) . First ( ) ;
101
+
102
+ Assert . AreEqual ( html , el . OuterHTML ) ;
103
+
104
+
105
+ }
81
106
}
82
107
}
Original file line number Diff line number Diff line change 11
11
<PackageLicenseFile >LICENSE.txt</PackageLicenseFile >
12
12
<RepositoryType ></RepositoryType >
13
13
<RepositoryUrl >https://github.com/NMyVision/HtmlParser</RepositoryUrl >
14
- <Version >1.0.4 </Version >
14
+ <Version >1.0.5 </Version >
15
15
16
16
17
17
<!-- Optional: Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
Original file line number Diff line number Diff line change @@ -110,9 +110,11 @@ private IEnumerable<HtmlNode> InternalParse(HtmlNode parent = null)
110
110
}
111
111
else if ( node . Tag . Equals ( "script" , StringComparison . OrdinalIgnoreCase ) )
112
112
{
113
- Dequeue ( ) ;
113
+ Dequeue ( ) ; // >
114
114
node . Content = GetUpTo ( "</script" ) ;
115
115
node . EndTag = "script" ;
116
+ Dequeue ( 9 ) ; // </script>
117
+ node . SetEndIndex ( index , Source ) ;
116
118
list . Add ( node ) ;
117
119
}
118
120
}
You can’t perform that action at this time.
0 commit comments