ItalicUnderParser

An IMfmParser implementation for detecting "italic" syntax. The string enclosed by "_" will be the search result.

Notes

  • Only allow characters matching the regex pattern of a-z0-9 \t (case-insensitive)

  • If the character before the starting symbol (the first "*") matches a-z0-9 (case-insensitive), it is not recognized as italic formatting.

  • The content cannot be left empty.

Functions

Link copied to clipboard
open override fun find(input: String, startAt: Int, context: IMfmParserContext): IMfmParserResult

Finds a substring in the input string starting from a given index.

Link copied to clipboard
open fun not(): IMfmParser

Returns a negative (not) version of the current MFM parser. A negative parser will return a failure result if the substring is found.

Link copied to clipboard
open fun optional(): IMfmParser

Returns an optional version of the current substring parser. An optional parser will return a successful result even if the substring is not found.