note 128563 added to intro.cmark
| From: | xuepeng dot gao dot ggle at gmail dot com | Date: | Sun, 21 May 2023 17:58:01 +0000 |
| Subject: | note 128563 added to intro.cmark | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-220518@lists.php.net to get a copy of this message | ||
in PHP 7.4.27
code:
<?php
$markDownContent="### test_H3 \r\n
#### test_H4";
$c = CommonMark\Parse($markDownContent);
var_dump($c);
echo "The markdown syntax content is converted to html content: \r\n";
$str = CommonMark\Render\HTML($c);
echo $str;
?>
output :
object(CommonMark\Node\Document)#1 (1) {
["children"]=>
array(2) {
[0]=>
object(CommonMark\Node\Heading)#2 (1) {
["children"]=>
array(1) {
[0]=>
object(CommonMark\Node\Text)#4 (1) {
["literal"]=>
string(7) "test_H3"
}
}
}
[1]=>
object(CommonMark\Node\Heading)#3 (1) {
["children"]=>
array(1) {
[0]=>
object(CommonMark\Node\Text)#4 (1) {
["literal"]=>
string(7) "test_H4"
}
}
}
}
}
The markdown syntax content is converted to html content:
<h3>test_H3</h3>
<h4>test_H4</h4>
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.13.130 (proxied: 2400:ddc0:1::30d4)
----
Manual Page -- https://php.net/manual/en/intro.cmark.php
Edit -- https://main.php.net/note/edit/128563
Del: integrated -- https://main.php.net/note/delete/128563/integrated
Del: useless -- https://main.php.net/note/delete/128563/useless
Del: bad code -- https://main.php.net/note/delete/128563/bad+code
Del: spam -- https://main.php.net/note/delete/128563/spam
Del: non-english -- https://main.php.net/note/delete/128563/non-english
Del: in docs -- https://main.php.net/note/delete/128563/in+docs
Del: other reasons-- https://main.php.net/note/delete/128563
Reject -- https://main.php.net/note/reject/128563
Search -- https://main.php.net/manage/user-notes.php