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
1 change: 1 addition & 0 deletions src/Elastic.Markdown/Myst/MarkdownParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public class MarkdownParser(
.UseGridTables()
.UsePipeTables()
.UseDirectives()
.UseDefinitionLists()
.UseEnhancedCodeBlocks()
.DisableHtml()
.UseHardBreaks()
Expand Down
59 changes: 59 additions & 0 deletions tests/authoring/Container/DefinitionLists.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information

module ``container elements``.``vertical definition lists``

open Xunit
open authoring

type ``simple multiline definition with markup`` () =

static let markdown = Setup.Markdown """
This is my `definition`
: And this is the definition **body**
Which may contain multiple lines
"""

[<Fact>]
let ``validate HTML`` () =
markdown |> convertsToHtml """
<dl>
<dt>This is my <code>definition</code> </dt>
<dd>
<p> And this is the definition <strong>body</strong> <br>
Which may contain multiple lines</p>
</dd>
</dl>
"""
[<Fact>]
let ``has no errors`` () = markdown |> hasNoErrors

type ``with embedded directives`` () =

static let markdown = Setup.Markdown """
This is my `definition`
: And this is the definition **body**
Which may contain multiple lines
:::{note}
My note
:::
"""

[<Fact>]
let ``validate HTML`` () =
markdown |> convertsToHtml """
<dl>
<dt>This is my <code>definition</code> </dt>
<dd>
<p> And this is the definition <strong>body</strong> <br>
Which may contain multiple lines</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>My note</p>
</div>
</dd>
</dl>
"""
[<Fact>]
let ``has no errors`` () = markdown |> hasNoErrors
4 changes: 4 additions & 0 deletions tests/authoring/authoring.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,8 @@
<Compile Include="Inline\InlineAnchors.fs" />
</ItemGroup>

<ItemGroup>
<Compile Include="Container\DefinitionLists.fs" />
</ItemGroup>

</Project>
Loading