From 6987384e81860fb5a05709efba86bcfb8846a646 Mon Sep 17 00:00:00 2001 From: Tobias Klika Date: Wed, 25 Dec 2013 21:08:21 +0100 Subject: [PATCH] reverse bodyOnly --- ReadSharp.Tests/ReadTests.cs | 2 +- ReadSharp/Models/ReadOptions.cs | 6 +++--- ReadSharp/Reader.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ReadSharp.Tests/ReadTests.cs b/ReadSharp.Tests/ReadTests.cs index e66d2ff..830d193 100644 --- a/ReadSharp.Tests/ReadTests.cs +++ b/ReadSharp.Tests/ReadTests.cs @@ -33,7 +33,7 @@ namespace ReadSharp.Tests Article result = await reader.Read(new Uri("http://frontendplay.com/story/4/http-caching-demystified-part-2-implementation"), new ReadOptions() { HasNoHeadline = true, - HasOnlyBody = false + HasHeaderTags = true }); Assert.Contains("", result.Content); diff --git a/ReadSharp/Models/ReadOptions.cs b/ReadSharp/Models/ReadOptions.cs index 523fd43..1660445 100644 --- a/ReadSharp/Models/ReadOptions.cs +++ b/ReadSharp/Models/ReadOptions.cs @@ -4,12 +4,12 @@ namespace ReadSharp public class ReadOptions { /// - /// Is only the body is returned + /// Are header tags and Doctype returned /// /// /// true if [has only body]; otherwise, false. /// - public bool HasOnlyBody { get; set; } + public bool HasHeaderTags { get; set; } /// /// Is no headline (h1) is included in generated HTML @@ -35,7 +35,7 @@ namespace ReadSharp { return new ReadOptions() { - HasOnlyBody = true, + HasHeaderTags = false, HasNoHeadline = false, UseDeepLinks = false }; diff --git a/ReadSharp/Reader.cs b/ReadSharp/Reader.cs index a571025..fb2a21a 100644 --- a/ReadSharp/Reader.cs +++ b/ReadSharp/Reader.cs @@ -214,7 +214,7 @@ namespace ReadSharp Url = uri.ToString(), DomSerializationParams = new DomSerializationParams() { - BodyOnly = options.HasOnlyBody, + BodyOnly = !options.HasHeaderTags, NoHeadline = options.HasNoHeadline, PrettyPrint = true, DontIncludeContentTypeMetaElement = true,