class link_helper

Methods

void
cleanup_tag(Tag $tag, Parser $parser)

Clean up and invalidate a LINK_TEXT tag if applicable

void
generate_link_text_tag(Tag $tag, Parser $parser)

Create a LINK_TEXT tag inside of a link

bool
should_shorten(Tag $tag, string $text)

Test whether we should shorten this tag's text

void
truncate_local_url(Tag $tag, string $board_url)

Remove the board's root URL from a the start of a string

void
truncate_text(Tag $tag)

Truncate the replacement text set in a LINK_TEXT tag

Details

at line 28
void cleanup_tag(Tag $tag, Parser $parser)

Clean up and invalidate a LINK_TEXT tag if applicable

Will invalidate the tag if its replacement text is the same as the original text and would have no visible effect

Parameters

Tag $tag

LINK_TEXT tag

Parser $parser Parser

Return Value

void

Create a LINK_TEXT tag inside of a link

Meant to only apply to linkified URLs and [url] BBCodes without a parameter

Parameters

Tag $tag

URL tag (start tag)

Parser $parser Parser

Return Value

void

at line 79
protected bool should_shorten(Tag $tag, string $text)

Test whether we should shorten this tag's text

Will test whether the tag either does not use any markup or uses a single [url] BBCode

Parameters

Tag $tag

URL tag

string $text

Original text

Return Value

bool

at line 91
void truncate_local_url(Tag $tag, string $board_url)

Remove the board's root URL from a the start of a string

Parameters

Tag $tag

LINK_TEXT tag

string $board_url

Forum's root URL (with trailing slash)

Return Value

void

at line 106
void truncate_text(Tag $tag)

Truncate the replacement text set in a LINK_TEXT tag

Parameters

Tag $tag

LINK_TEXT tag

Return Value

void