ILIAS
trunk Revision v11.0_alpha-2638-g80c1d007f79
◀ ilDoc Overview
SimpleDocumentMarkdown.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
SimpleDocumentMarkdown
extends
Markdown
28
{
32
public
function
getSupportedStructure
(): array
33
{
34
return
[
35
Structure::BOLD,
36
Structure::ITALIC,
37
Structure::HEADING_1,
38
Structure::HEADING_2,
39
Structure::HEADING_3,
40
Structure::HEADING_4,
41
Structure::HEADING_5,
42
Structure::HEADING_6,
43
Structure::UNORDERED_LIST,
44
Structure::ORDERED_LIST,
45
Structure::PARAGRAPH,
46
Structure::LINK,
47
Structure::BLOCKQUOTE,
48
Structure::CODE
49
];
50
}
51
52
public
function
fromString
(
string
$text):
Text
\
SimpleDocumentMarkdown
53
{
54
return
new
Text\SimpleDocumentMarkdown
($this, $text);
55
}
56
57
public
function
isRawStringCompliant
(
string
$text): bool
58
{
59
$options = mb_regex_set_options();
60
try
{
61
mb_regex_set_options(
"m"
);
62
return
!mb_ereg_match(
63
'.*(('
. MRE::IMAGE->value .
')|('
. MRE::REF->value .
')|('
. MRE::IMAGE_REF_USAGE->value .
'))'
,
64
$text
65
);
66
}
finally
{
67
mb_regex_set_options($options);
68
}
69
}
70
}
ILIAS\Data\Text
Definition:
Factory.php:21
ILIAS\Data\Text\Shape\SimpleDocumentMarkdown\isRawStringCompliant
isRawStringCompliant(string $text)
Definition:
SimpleDocumentMarkdown.php:57
ILIAS\Data\Text\Text
Definition:
Text.php:23
ILIAS\Data\Text\Shape\SimpleDocumentMarkdown\getSupportedStructure
getSupportedStructure()
Definition:
SimpleDocumentMarkdown.php:32
ILIAS\Data\Text\SimpleDocumentMarkdown
Definition:
SimpleDocumentMarkdown.php:25
ILIAS\Data\Text\Markdown
Definition:
Markdown.php:25
ILIAS\Data\Text\Shape\SimpleDocumentMarkdown
Definition:
SimpleDocumentMarkdown.php:27
ILIAS\Data\Text\CODE
Definition:
Structure.php:39
ILIAS\Data\Text\Shape
Definition:
Markdown.php:21
ILIAS\Data\Text\Structure
Structure
Definition:
Structure.php:23
ILIAS\Data\Text\Shape\SimpleDocumentMarkdown\fromString
fromString(string $text)
Definition:
SimpleDocumentMarkdown.php:52
ILIAS\Data\Text\Markup\MarkdownRegExps
MarkdownRegExps
Regular expressions to detect constructs from CommonMarkdown.
Definition:
MarkdownRegExps.php:28
components
ILIAS
Data
src
Text
Shape
SimpleDocumentMarkdown.php
Generated on Sun Aug 31 2025 23:02:45 for ILIAS by
1.8.13 (using
Doxyfile
)