I am converting markdown to html in pagedown editor in the following way:
<div id="question_div" class="post_text">
</div>
<script type="text/javascript">
$(document).ready(function() {
var q_converter = new Markdown.getSanitizingConverter();
$("#question_div").html(q_converter.makeHtml(<?php echo json_encode($q_detail);?>));
});
</script>
This is working well. The problem is, guess the value of $q_detail
is This is not **working** well
. When I open the view page source
page, it displays something like
$("#question_div").html(q_converter.makeHtml("This is not **working** well"));
which I guess is not SEO friendly.
How can I make it display the $q_detail
like This is not <b>working</b> well
outside of the <script>
tag to make it more SEO friendly?
You can do that :
<?php include('Parsedown.php') ?>
<div id="question_div" class="post_text">
<?php echo $parsedown->parse($q_detail);?>
</div>
After installing Parsedown
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.