Method in MarkupParseResult
Deletes an attribute from this markup.
This method deletes the range of text covered by attributeToDelete
, and updates the other attributes in this markup as follows:
Attributes that start and end before the deleted attribute are unmodified.
Attributes that start before the deleted attribute and end inside it are truncated to remove the part overlapping the deleted attribute.
Attributes that have the same position and length as the deleted attribute are deleted, if they apply to any text.
Attributes that start and end within the deleted attribute are deleted.
Attributes that start within the deleted attribute, and end outside it, have their start truncated to remove the part overlapping the deleted attribute.
Attributes that start after the deleted attribute have their start point adjusted to account for the deleted text.
This method does not modify the current object. A new MarkupParseResult is returned.
If attributeToDelete
is not an attribute of this MarkupParseResult, the behaviour is undefined.
A new MarkupParseResult object, with the plain text modified and an updated collection of attributes.
Method in MarkupParseResult
Returns the substring of Text covered by attribute
Position and Length properties.
If the attribute's Length property is zero, this method returns the empty string.
This method does not check to see if attribute
is an attribute belonging to this MarkupParseResult. As a result, if you pass an attribute that doesn't belong, it may describe a range of text that does not appear in Text. If this occurs, an System.IndexOutOfRangeException
will be thrown.
Name | Description |
---|---|
The text contained within the attribute.
Method in MarkupParseResult
Gets the first attribute with the specified name, if present.
Name | Description |
---|---|
true
if the MarkupParseResult contains an attribute with the specified name; otherwise, false
.
Struct in Yarn.Markup
Inherits from System.ValueType
The result of parsing a line of marked-up text.
You do not create instances of this struct yourself. It is created by objects that can parse markup, such as Dialogue .
Name | Description |
---|---|
Name | Description |
---|---|
Dialogue.ParseMarkup(string): Parses a line of text, and produces a MarkupParseResult containing the results.
Name | Description |
---|---|
Yarn.Markup.MarkupAttribute attribute
The attribute to get the text for.
Yarn.Markup.MarkupAttribute attributeToDelete
The attribute to remove.
string
name
The name of the attribute to get.
Yarn.Markup.MarkupAttribute attribute
When this method returns, contains the attribute with the specified name, if the attribute is found; otherwise, the default MarkupAttribute . This parameter is passed uninitialized.
The list of MarkupAttribute s in this parse result.
The original text, with all parsed markers removed.
Deletes an attribute from this markup.
Returns the substring of Text covered by attribute
Position and Length properties.
Gets the first attribute with the specified name, if present.