Skip to content

Changed text based TagHelpers to rendering Chromes with internal span not div #40

New issue

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

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

Already on GitHub? # to your account

Open
wants to merge 2 commits 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
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public override void Process(TagHelperContext context, TagHelperOutput output)
if (Editable && richTextField.OpeningChrome != null)
{
html += _chromeRenderer.Render(richTextField.OpeningChrome);
html += "<div>";
html += "<span>";
}

bool outputEditableMarkup = Editable && !string.IsNullOrEmpty(richTextField.EditableMarkup);
Expand All @@ -65,7 +65,7 @@ public override void Process(TagHelperContext context, TagHelperOutput output)

if (Editable && richTextField.ClosingChrome != null)
{
html += "</div>";
html += "</span>";
html += _chromeRenderer.Render(richTextField.ClosingChrome);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public override void Process(TagHelperContext context, TagHelperOutput output)
if (Editable && field.OpeningChrome != null)
{
html += _chromeRenderer.Render(field.OpeningChrome);
html += "<div>";
html += "<span>";
isHtml = true;
}

Expand All @@ -67,7 +67,7 @@ public override void Process(TagHelperContext context, TagHelperOutput output)

if (Editable && field.ClosingChrome != null)
{
html += "</div>";
html += "</span>";
html += _chromeRenderer.Render(field.ClosingChrome);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,7 @@ public void Process_RenderingChromesAreNotNull_ChromesAreOutput(
// Assert
chromeRenderer.Received().Render(openingChrome);
chromeRenderer.Received().Render(closingChrome);
tagHelperOutput.Content.GetContent().Should().Be($"{chromeRenderer.Render(openingChrome)}<span>{TestHtml}</span>{chromeRenderer.Render(closingChrome)}");
}

private static ModelExpression GetModelExpression(Field model)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ public void Process_RenderingChromesAreNotNull_ChromesAreOutput(
// Assert
chromeRenderer.Received().Render(openingChrome);
chromeRenderer.Received().Render(closingChrome);
tagHelperOutput.Content.GetContent().Should().Be($"{chromeRenderer.Render(openingChrome)}<span>{TestText}</span>{chromeRenderer.Render(closingChrome)}");
}

private static IEnumerable<object[]> GetModelExpressionTestData()
Expand Down
Loading