ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ ilDoc Overview
WordOnlyMarkdown.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Data\Text\Shape
;
22
23
use
ILIAS\Data\Text\Structure
;
24
use
ILIAS\Data\Text
;
25
use
ILIAS\Data\Text\Markup\MarkdownRegExps
as MRE;
26
27
class
WordOnlyMarkdown
extends
SimpleDocumentMarkdown
28
{
32
public
function
getSupportedStructure
(): array
33
{
34
return
[
35
Structure::BOLD,
36
Structure::ITALIC
37
];
38
}
39
40
public
function
fromString
(
string
$text):
Text
\
WordOnlyMarkdown
41
{
42
return
new
Text\WordOnlyMarkdown
($this, $text);
43
}
44
45
public
function
isRawStringCompliant
(
string
$text): bool
46
{
47
$options = mb_regex_set_options();
48
try
{
49
mb_regex_set_options(
"m"
);
50
return
!mb_ereg_match(
51
'.*(('
. MRE::HEADINGS->value .
')|('
. MRE::UNORDERED_LIST->value .
')|('
. MRE::ORDERED_LIST->value .
')|'
.
52
'('
. MRE::LINE_BREAK->value .
')|('
. MRE::PARAGRAPH->value .
')|('
. MRE::BLOCKQUOTE->value .
')|'
.
53
'('
. MRE::CODEBLOCK->value .
')|('
. MRE::REF->value .
')|('
. MRE::LINK_REF_USAGE->value .
')|'
.
54
'('
. MRE::IMAGE->value .
')|('
. MRE::IMAGE_REF_USAGE->value .
'))'
,
55
$text
56
);
57
}
finally
{
58
mb_regex_set_options($options);
59
}
60
}
61
}
ILIAS\Data\Text
Definition:
Factory.php:21
ILIAS\Data\Text\Shape\WordOnlyMarkdown
Definition:
WordOnlyMarkdown.php:27
ILIAS\Data\Text\Text
Definition:
Text.php:23
ILIAS\Data\Text\Shape\WordOnlyMarkdown\isRawStringCompliant
isRawStringCompliant(string $text)
Definition:
WordOnlyMarkdown.php:45
ILIAS\Data\Text\Shape\WordOnlyMarkdown\fromString
fromString(string $text)
Definition:
WordOnlyMarkdown.php:40
ILIAS\Data\Text\Shape\WordOnlyMarkdown\getSupportedStructure
getSupportedStructure()
Definition:
WordOnlyMarkdown.php:32
ILIAS\Data\Text\Shape\SimpleDocumentMarkdown
Definition:
SimpleDocumentMarkdown.php:27
ILIAS\Data\Text\Shape
Definition:
Markdown.php:21
ILIAS\Data\Text\WordOnlyMarkdown
Definition:
WordOnlyMarkdown.php:25
ILIAS\Data\Text\Structure
Structure
Definition:
Structure.php:23
ILIAS\Data\Text\Markup\MarkdownRegExps
MarkdownRegExps
Regular expressions to detect constructs from CommonMarkdown.
Definition:
MarkdownRegExps.php:28
components
ILIAS
Data
src
Text
Shape
WordOnlyMarkdown.php
Generated on Sun Aug 31 2025 23:02:45 for ILIAS by
1.8.13 (using
Doxyfile
)