LangTextRole
extends BaseTextRole
in package
uses
ReportsViolations
FinalYes
Role to mark text as being in another language and, optionally, another text direction.
Example:
:lang:`مثال عربي (ar)`
:lang:`مثال عربي (ar, rtl)`
Table of Contents
Properties
- $class : string
- $name : string
- $logger : LoggerInterface|ViolationReporter
Methods
- __construct() : mixed
- getAliases() : string[]
- getClass() : string
- getName() : string
- processNode() : InlineNode
- setClass() : void
- withName() : BaseTextRole
- reportViolation() : void
Properties
$class
protected
string
$class
= ''
$name
protected
string
$name
= 'lang'
$logger read-only
private
LoggerInterface|ViolationReporter
$logger
Methods
__construct()
public
__construct(LoggerInterface|ViolationReporter $logger) : mixed
Parameters
- $logger : LoggerInterface|ViolationReporter
getAliases()
public
getAliases() : string[]
Return values
string[]getClass()
public
getClass() : string
Return values
stringgetName()
public
getName() : string
Return values
stringprocessNode()
public
processNode(DocumentParserContext $documentParserContext, string $role, string $content, string $rawContent) : InlineNode
Parameters
- $documentParserContext : DocumentParserContext
- $role : string
- $content : string
-
the content with backslash escapes removed per spec
- $rawContent : string
-
the raw content, including backslash escapes
Return values
InlineNodesetClass()
public
setClass(string $class) : void
Parameters
- $class : string
withName()
public
withName(string $name) : BaseTextRole
Parameters
- $name : string
Return values
BaseTextRolereportViolation()
private
reportViolation(LoggerInterface|ViolationReporter|null $reporter, Violation $violation) : void
Parameters
- $reporter : LoggerInterface|ViolationReporter|null
- $violation : Violation