Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5971495
HtmlTagInsertablesSuggester.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
702 B
Referenced Files
None
Subscribers
None
HtmlTagInsertablesSuggester.php
View Options
<?php
declare
(
strict_types
=
1
);
namespace
MediaWiki\Extension\Translate\TranslatorInterface\Insertable
;
/**
* Suggester for HTML tags
* @author Niklas Laxström
* @license GPL-2.0-or-later
* @since 2020.12
*/
class
HtmlTagInsertablesSuggester
implements
InsertablesSuggester
{
/** @var InsertablesSuggester */
private
$suggester
;
public
function
__construct
()
{
$this
->
suggester
=
new
RegexInsertablesSuggester
(
[
'regex'
=>
'~(?<open><([a-z][a-z0-9]*)
\b
[^>]*>).*?(?<close></
\2
>)~'
,
'display'
=>
'$open$close'
,
'pre'
=>
'$open'
,
'post'
=>
'$close'
,
]
);
}
public
function
getInsertables
(
string
$text
):
array
{
return
$this
->
suggester
->
getInsertables
(
$text
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Oct 3, 15:13 (1 h, 36 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
92/bd/39de0c6d1f0cd99fbc6df1416ac5
Default Alt Text
HtmlTagInsertablesSuggester.php (702 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment