diff --git a/CHANGELOG.md b/CHANGELOG.md index f7e38b7..5be01fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -31,6 +31,7 @@ Fixes - Fixed TextInput not working correctly when using surrogate pairs - Fixed InputHandler touch states being initialized incorrectly when touch handling is disabled - Fixed empty NinePatch regions stalling when using tile mode +- Fixed bold and italic formatting code closing tags working on each other ### MLEM.Ui Additions diff --git a/Demos/TextFormattingDemo.cs b/Demos/TextFormattingDemo.cs index 95d1354..1d32021 100644 --- a/Demos/TextFormattingDemo.cs +++ b/Demos/TextFormattingDemo.cs @@ -15,7 +15,7 @@ namespace Demos { private const string Text = "MLEM's text formatting system allows for various formatting codes to be applied in the middle of a string. Here's a demonstration of some of them.\n\n" + - "You can write in bold, italics, with an underline, strikethrough, with a drop shadow whose color and offset you can modify in each application of the code, with an outline that you can also modify dynamically, or with various types of combined formatting codes.\n\n" + + "You can write in bold, italics, with an underline, strikethrough, with a drop shadow whose color and offset you can modify in each application of the code, with an outline that you can also modify dynamically, or with various types of combined formatting codes.\n\n" + "You can apply custom colors to text, including all default MonoGame colors and inline custom colors.\n\n" + "You can also use animations like a wobbly one, as well as create custom ones using the Code class.\n\n" + "You can also display icons in your text, and use superscript or subscript formatting!\n\n" + diff --git a/MLEM/Formatting/Codes/FontCode.cs b/MLEM/Formatting/Codes/FontCode.cs index 52e96c1..f1e437a 100644 --- a/MLEM/Formatting/Codes/FontCode.cs +++ b/MLEM/Formatting/Codes/FontCode.cs @@ -18,5 +18,11 @@ namespace MLEM.Formatting.Codes { return this.font?.Invoke(defaultPick); } + /// + public override bool EndsHere(Code other) { + // turning a string bold/italic should only end when that specific code is ended using SimpleEndCode + return false; + } + } }