Showdown module
Showdown.js interface for Yii2, (*1)
Version 1.2.2 -- release 2021-10-04, (*2)
Based on https://github.com/showdownjs version 1.7.1, (*3)
Detailed documentation of showdownjs, (*4)
Installation
The preferred way to install this extension is through composer., (*5)
To install, either run, (*6)
composer require uhi67/showdown "^1.2"
or add, (*7)
"uhi67/showdown" : "^1.2"
or clone form github, (*8)
git clone https://github.com/uhi67/showdown
Usage
in the view
<?php
// ...
uhi67\showdown\ShowdownAsset::register($this); // or put this into the global layout
?>
<div class="showdown">
<pre class="markdown"><?= $content ?></pre>
</div>
where $content
is the markdown content readed from your .md file., (*9)
Change log
1.2.2 -- 2021-10-04
- Removed unnecessary trace
1.2.1 -- 2021-02-03
- Replaces "--" (double hyphen) to mdash character
1.2 -- 2020-12-22
- if .simple class is used in pre.markdown, will not render links and images
1.1 -- 2020-04-21
- simpleLineBreaks option changed to false -- now ignores simple line breaks in source