add Raw HTML to Article; fixes #9
This commit is contained in:
@@ -41,6 +41,14 @@ namespace ReadSharp
|
||||
/// </value>
|
||||
public bool ContentExtracted { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the raw HTML.
|
||||
/// </summary>
|
||||
/// <value>
|
||||
/// The raw HTML.
|
||||
/// </value>
|
||||
public string Raw { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Plain content without HTML tags.
|
||||
/// </summary>
|
||||
|
||||
+8
-2
@@ -44,6 +44,11 @@ namespace ReadSharp
|
||||
/// </summary>
|
||||
protected List<string> _currentPages = new List<string>();
|
||||
|
||||
/// <summary>
|
||||
/// The raw HTML from the last request
|
||||
/// </summary>
|
||||
private string _rawHTML = String.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Redirect faulty mobile URIs to desktop equivalents
|
||||
/// </summary>
|
||||
@@ -186,6 +191,7 @@ namespace ReadSharp
|
||||
Description = response.TranscodingResult.ExtractedDescription,
|
||||
Content = response.TranscodingResult.ExtractedContent,
|
||||
ContentExtracted = response.TranscodingResult.ContentExtracted ? wordCount > 0 : false,
|
||||
Raw = _rawHTML,
|
||||
PlainContent = plainContent,
|
||||
WordCount = wordCount,
|
||||
PageCount = response.PageCount,
|
||||
@@ -216,10 +222,10 @@ namespace ReadSharp
|
||||
// response stream to text
|
||||
textStream.Position = 0;
|
||||
StreamReader streamReader = new StreamReader(textStream, encoding ?? Encoding.UTF8);
|
||||
string text = streamReader.ReadToEnd();
|
||||
_rawHTML = streamReader.ReadToEnd();
|
||||
|
||||
// set properties for processing
|
||||
TranscodingInput transcodingInput = new TranscodingInput(text)
|
||||
TranscodingInput transcodingInput = new TranscodingInput(_rawHTML)
|
||||
{
|
||||
Url = uri.ToString(),
|
||||
DomSerializationParams = new DomSerializationParams()
|
||||
|
||||
Reference in New Issue
Block a user