Closed buttflattery closed 6 years ago
Use Html::encode
on the text before you process using Markdown::process
.
@kartik-v Well to my surprise the Html::encode()
does not solve the issue, instead you have to provide the closing ?>
tags along with the starting tags to make it work correctly when using $this->render('README.md')
to load the text.
Prerequisites
master
branch of yii2-markdown.Steps to reproduce the issue
1.Install the extension 2.crate a readme.md file and add the following containing the
<?php
tagExpected behavior and actual behavior
When I follow those steps, I see...
I was expecting... The formatted output
If you remove the
<?php
tag from the text to be processed then it works okBUT
If you use it in the following way it even works along the
<?php
tagEnvironment
Yii 2.0.15.1
Browsers
Operating System
Libraries
Isolating the problem