Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FSharp.Data.Html suggested change to enable people to use the html parser without hiding representation without having to hack the code itself. #1499

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/FSharp.Data.Html.Core/FSharp.Data.Html.Core.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<PackageIcon>logo.png</PackageIcon>
<!-- always have tailcalls on for design time compiler add-in to allow repo to compile in DEBUG, see https://github.com/fsprojects/FSharp.Data/issues/1410 -->
<Tailcalls>true</Tailcalls>
<DefineConstants>$(DefineConstants);HIDE_REPRESENTATION</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Include="HtmlCssSelectors.fs" />
Expand Down
3 changes: 2 additions & 1 deletion src/FSharp.Data.Html.Core/HtmlActivePatterns.fs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace FSharp.Data

#if HIDE_REPRESENTATION
[<AutoOpen>]
#endif
module HtmlActivePatterns =
let (|HtmlElement|HtmlText|HtmlComment|HtmlCData|) (node: HtmlNode) =
match node with
Expand Down
8 changes: 6 additions & 2 deletions src/FSharp.Data.Html.Core/HtmlNode.fs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ open System.Text
/// </namespacedoc>
///
type HtmlAttribute =

#if HIDE_REPRESENTATION
internal
#endif
| HtmlAttribute of name: string * value: string

/// <summary>
Expand All @@ -29,8 +30,9 @@ type HtmlAttribute =
[<RequireQualifiedAccess>]
/// Represents an HTML node. The names of elements are always normalized to lowercase
type HtmlNode =

#if HIDE_REPRESENTATION
internal
#endif
| HtmlElement of name: string * attributes: HtmlAttribute list * elements: HtmlNode list
| HtmlText of content: string
| HtmlComment of content: string
Expand Down Expand Up @@ -190,7 +192,9 @@ type HtmlNode =
[<StructuredFormatDisplay("{_Print}")>]
/// Represents an HTML document
type HtmlDocument =
#if HIDE_REPRESENTATION
internal
#endif
| HtmlDocument of docType: string * elements: HtmlNode list

/// <summary>
Expand Down
4 changes: 3 additions & 1 deletion src/FSharp.Data.Html.Core/HtmlRuntime.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ open FSharp.Data
open FSharp.Data.HtmlExtensions
open FSharp.Data.Runtime
open FSharp.Data.Runtime.StructuralTypes

#if !HIDE_REPRESENTATION
open FSharp.Data.HtmlActivePatterns
#endif
#nowarn "10001"

// --------------------------------------------------------------------------------------
Expand Down
Loading