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