I have a function that returns a string of HTML code for a jQuery plugin, parsed using PHP Markdown:
function awesome_function() {
$html = Markdown('# Hello World!');
return $html;
}
... but PHP (5.3.2) returns this:
"<h1>Hello World!<\/h1>
"
... instead of what I want, which is this:
<h1>Hello World!</h1>
How do I get it to return the non-escaped HTML value? Changing return
to echo
works, but then I have the return
status of the function returned as well (true|false|null), which I don't want.
EDIT: Not sure if it's relevant, but I just realized that I probably should have mentioned that my function is a public function for a class, as such:
class Awesome {
public function awesome_function() { /* ... */ }
}
For @fredrick:
$('.edit').editable('/controllers/awesome_controller.php', {
id: 'identifier',
name: 'content',
submitdata: { action: 'awesome_function' },
submit: 'Ok',
cancel: 'Cancel',
loadurl: '/controllers/awesome_controller.php',
loaddata: { action: 'load_original_markdown' }
});