这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
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
8 changes: 8 additions & 0 deletions Microsoft.DotNet.Interactive.FSharp.Tests/ApiTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,11 @@ type ApiTests() =
[<Fact>]
member __.``inner HTML from another tag``() =
Assert.Equal("<div><a>foo</a></div>", div.innerHTML(a.innerHTML("foo")).ToString())

[<Fact>]
member __.``inner HTML varargs 0``() =
Assert.Equal("<div></div>", div.innerHTML().ToString())

[<Fact>]
member __.``inner HTML varargs 2``() =
Assert.Equal("<div>ab</div>", div.innerHTML("a", "b").ToString())
5 changes: 3 additions & 2 deletions Microsoft.DotNet.Interactive.FSharp/FSharpPocketViewTags.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@

namespace Microsoft.DotNet.Interactive.FSharp

open System
open Microsoft.AspNetCore.Html
open Microsoft.DotNet.Interactive.Rendering

type FSharpPocketViewTags(p: PocketView) as this =
override __.ToString() = p.ToString()
abstract member innerHTML: obj -> FSharpPocketViewTags
abstract member innerHTML: [<ParamArray>] content: obj[] -> FSharpPocketViewTags
abstract member Item: string * obj -> FSharpPocketViewTags with get
default __.innerHTML content =
p.SetContent([|content|])
p.SetContent(content)
this
default __.Item
with get (attribute: string, value: obj) =
Expand Down