AnonymousPhraseRule
extends ReferenceRule
in package
uses
EmbeddedReferenceParser
FinalYes
Rule to parse for anonymous references
Syntax example:
Example anonymous reference
__
Example reference <http://phpdoc.org>
__
Tags
Table of Contents
Properties
- $referenceRegex : string
- https://regex101.com/r/KadqKx/1
Methods
- applies() : bool
- apply() : AbstractLinkInlineNode|null
- getPriority() : int
- createReference() : AbstractLinkInlineNode
- rollback() : void
- createAnonymousReference() : AbstractLinkInlineNode
- extractEmbeddedReference() : ReferenceData
Properties
$referenceRegex
https://regex101.com/r/KadqKx/1
private
string
$referenceRegex
= '/^(.*?)(<([^<]+)>)?$/s'
Methods
applies()
public
applies(InlineLexer $lexer) : bool
Parameters
- $lexer : InlineLexer
Return values
boolapply()
public
apply(BlockContext $blockContext, InlineLexer $lexer) : AbstractLinkInlineNode|null
Parameters
- $blockContext : BlockContext
- $lexer : InlineLexer
Return values
AbstractLinkInlineNode|nullgetPriority()
public
getPriority() : int
Return values
intcreateReference()
protected
createReference(BlockContext $blockContext, string $reference[, string|null $text = null ][, bool $registerLink = true ]) : AbstractLinkInlineNode
Parameters
- $blockContext : BlockContext
- $reference : string
- $text : string|null = null
- $registerLink : bool = true
Return values
AbstractLinkInlineNoderollback()
protected
rollback(InlineLexer $lexer, int $position) : void
Parameters
- $lexer : InlineLexer
- $position : int
createAnonymousReference()
private
createAnonymousReference(BlockContext $blockContext, string $value) : AbstractLinkInlineNode
Parameters
- $blockContext : BlockContext
- $value : string
Return values
AbstractLinkInlineNodeextractEmbeddedReference()
private
extractEmbeddedReference(string $text) : ReferenceData
Parameters
- $text : string