Closed ButGuc closed 6 years ago
Those checkboxes are a feature of GitLab (and GitHub as well), but are not part of standard Markdown.
You could either add a custom rule to Jigsaw's markdown parser to handle these task lists (see an example of how to do that here), or swap out the markdown parser with one that implements it already. Jigsaw uses Parsedown Extra as its parser, and it appears someone has extended it to include the checkbox rule. So, you could do the following:
composer require leblanc-simon/parsedown-checkbox
Then, add this to bootstrap.php
:
use Mni\FrontYAML\Markdown\MarkdownParser;
use TightenCo\Jigsaw\Parsers\ParsedownExtraParser;
$container->bind(MarkdownParser::class, ParsedownCheckboxParser::class);
class ParsedownCheckboxParser implements MarkdownParser
{
public function __construct()
{
$this->parser = new ParsedownCheckbox();
}
public function parse($markdown)
{
return $this->parser->parse($markdown);
}
}
There do seem to be some minor issues with parsedown-checkbox
(it will throw a PHP Warning
in the console when you run build
), and you'll need to style your output to remove the list bullets (parsedown-checkbox
adds a parsedown-task-list
class, so that should be easy), but otherwise it worked pretty well in my testing.
I tried the solution but; I could not do which is wanted. instead of this solution, I used kramdown
Thank you for your answer
Jigsaw GitLab