ITextEncoder Interface
- Namespace
- Kampute.DocToolkit.Formatters
- Assembly
- Kampute.DocToolkit.dll
Definition
Defines a contract for text encoders of specific formats.
public interface ITextEncoder- Implemented by
Remarks
Methods
| Encode(ReadOnlySpan<char>, TextWriter) | Encodes the specified text for the target format and writes it to the specified writer. |

Implementations handle format-specific encoding concerns, like escaping special characters that have syntactic meaning in the target format. For example, HTML encoders escape characters like '<' and '>', while Markdown encoders escape characters like '*' and '#'.
This interface is typically used in conjunction with documentation formatters to ensure that text content is safely embedded in generated documentation without breaking the format's syntax.