You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
836 B
30 lines
836 B
@using System.Web |
|
<div class="escapeCodeContainer"> |
|
<textarea style="background-color: #2C2E33; width: 100%; border:3px solid #A8ADB9; border-radius:1px; padding: 8px;" |
|
rows="8" |
|
@onchange="OnChange" /> |
|
|
|
<textarea style="background-color: #2C2E33; width: 100%; border:3px solid #A8ADB9; border-radius:1px; padding: 8px;" |
|
rows="8" |
|
@bind="Output" /> |
|
</div> |
|
|
|
<style> |
|
.escapeCodeContainer { |
|
display: grid; |
|
grid-template-columns: 1fr 1fr; |
|
gap: 8px; |
|
} |
|
</style> |
|
|
|
@code { |
|
string Output = ""; |
|
|
|
public void OnChange(ChangeEventArgs changeEventArgs) |
|
{ |
|
var encoded = HttpUtility.HtmlEncode(changeEventArgs.Value!.ToString()); |
|
Output = encoded?.Replace("@", "@@")!; |
|
Output = Output.Replace("\n", "<br />"); |
|
} |
|
|
|
} |