You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixed a bug where self-closing replacement markup was consuming whitespace.
Changed how invisible characters work in replacement markup, now you can say how many (if any) invisible characters were added into the string during replacement.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
8
8
9
9
### Added
10
10
11
+
-`ReplacementMarkerResult` struct that encapsulates diagnostics of replacement markup processors and also an invisible characters count.
12
+
- this allows for replacement markup to declare how many invisible characters they have added
13
+
- this is necessary because both Unity and Godot (and likely every tool out there) has some variant of rich text strings where the attributes on the rich text is within the string itself
14
+
- any sibling markup following the replacement needs to not be pushed down by the invisible elements of the string
15
+
11
16
### Updated
12
17
13
18
- When the `tags:` header on a node is blank, `Node.Tags` now returns an empty collection, instead of a collection containing a single empty string.
@@ -22,6 +27,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
22
27
- Language Server: hovering smart variables now shows their definition.
23
28
- Language Server: Make compilation asynchronous
24
29
- Language Server: 'Undeclared variable' warnings have had their severity reduced to "hint".
30
+
- Fixed a bug where self-closing replacement markup was consuming whitespace
31
+
-`IAttributeMarkerProcessor` now return a `ReplacementMarkerResult` struct instead of just a list of diagnostics
[InlineData("this is a line with non-replacement[a/] markup","this is a line with non-replacement markup",newstring[]{"a"},newint[]{35})]
699
+
[InlineData("this is a line [bold]with some replacement[/bold] markup and a non-replacement[a/] markup","this is a line <b>with some replacement</b> markup and a non-replacement markup",newstring[]{"a"},newint[]{65})]
700
+
[InlineData("this is a [bold]line with some [italics]nested[a trimwhitespace=false /] tags[/italics][b trimwhitespace=false /][/bold] in[c trimwhitespace=false /] it","this is a <b>line with some <i>nested tags</i></b> in it",newstring[]{"a","b","c"},newint[]{31,36,39})]
701
+
[InlineData("this is a line with [blocky]markup[/blocky] that actually has[a trimwhitespace=false /] visible characters","this is a line with [markup] that actually has visible characters",newstring[]{"a"},newint[]{46})]
702
+
[InlineData("this is a line with [wacky]markup[/wacky] that actually has[a trimwhitespace=false /] both","this is a line with <b>[markup]</b> that actually has both",newstring[]{"a"},newint[]{46})]
703
+
[InlineData("this is a line with [wacky]internal[a trimwhitespace=false /] both[/wacky] markup","this is a line with <b>[internal both]</b> markup",newstring[]{"a"},newint[]{29})]
704
+
[InlineData("this is a [wacky]line with some [blocky]nested[a trimwhitespace=false /] tags[/blocky][b trimwhitespace=false /][/wacky] in[c trimwhitespace=false /] it","this is a <b>[line with some [nested tags]]</b> in it",newstring[]{"a","b","c"},newint[]{33,39,43})]
/// The number of invisible characters added into the line during processing.
81
+
/// </summary>
82
+
/// <remarks>
83
+
/// This will vary depending on what the replacement markup needs to do.
84
+
/// <list type="bullet">
85
+
/// <item>
86
+
/// <para>
87
+
/// When only inserting rich-text tags, this should be the length of all inserted text.
88
+
/// For example <c>"this is text with [bold]some bold[/bold] elements"</c> translated into Unity style rich-text become <c>"this is text with <b>some bold</b> elements"</c>.
89
+
/// In this case then the value of <c>InvisibleCharacters</c> would be seven.
90
+
/// </para>
91
+
/// </item>
92
+
/// <item>
93
+
/// <para>
94
+
/// When only modifying the content of the children text, such as making all text upper case, this should be <c>0</c>.
95
+
/// For example <c>"this is text with [upper]some uppercased[/upper] elements"</c> is transformed into <c>"this is text with SOME UPPERCASED elements"</c>.
96
+
/// The number of invisible character will be zero.
97
+
/// </para>
98
+
/// </item>
99
+
/// <item>
100
+
/// When adding new content into the line (regardless of being added at the start, end, or middle) this should be zero but the replacement processor should make sure to shift along it's children attributes where appropriate.
101
+
/// For example <c>"this is text with [emph]some emphasised[/emph] elements"</c> transformed into <c>"this is text with !!some emphasised!! elements"</c> the value of <c>InvisibleCharacters</c> would be zero.
102
+
/// In this case however the <c>childAttributes</c> in <see cref="IAttributeMarkerProcessor.ProcessReplacementMarker"/> would need to be shifted down two.
103
+
/// </item>
104
+
/// </list>
105
+
/// </remarks>
106
+
publicintInvisibleCharacters;
107
+
108
+
/// <summary>
109
+
/// Convenience constructor for replacement markup results.
110
+
/// </summary>
111
+
/// <param name="diagnostics">The diagnostics generated during processing</param>
112
+
/// <param name="invisibleCharacters">the number of invisible characters generated during processing.</param>
0 commit comments