You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the sample at README.md the parsed ToC is parenthesized with DIV tags with id="toc" attributes as below. But I want to change the "id" attribute value to another.
<divid="toc"><ul><li><ahref="#One">One</a><ul><li><ahref="#Two">Two</a></li></ul></li><li><ahref="#One2">One2</a></li></ul></div><hr />
<h1id="One" name="One">One</h1><p>Something about One</p><h2id="Two" name="Two">Two</h2><p>Something about Two</p><h1id="One2" name="One2">One2</h1><p>Something about One2</p>
Sample code
<?phprequire_once__DIR__ . '/vendor/autoload.php';
// Sample Markdown with '[toc]' tag included$text_markdown = file_get_contents('SAMPLE.md');
$Parsedown = new \ParsedownToC();
// Parses '[toc]' tag to ToC if exists$html = $Parsedown->text($text_markdown);
echo$html . PHP_EOL;
$ cat SAMPLE.md
[toc]---# Head1
Sample text of head 1.
## Head1-1
Sample text of head 1-1.
# Head2
Sample text of head 2.
## 見出し2-1
Sample text of head2-1.
This feature will be implemented for more than one 👍
The text was updated successfully, but these errors were encountered:
TL; DR
Add a method that changes the "
id
" attribute value from "toc
" to ad hoc value somewhat like below.TS; DR
In the sample at README.md the parsed ToC is parenthesized with
DIV
tags withid="toc"
attributes as below. But I want to change the "id
" attribute value to another.Sample code
This feature will be implemented for more than one 👍
The text was updated successfully, but these errors were encountered: