storypioneers / kirby-wysiwyg

WYSIWYG panel field for Kirby CMS
Other
125 stars 16 forks source link

Shift+Enter #28

Open louiswalch opened 8 years ago

louiswalch commented 8 years ago

Using SHIFT+ENTER to make a line break between lines is replaced with a paragraph break when you save the page.

JonasDoebertin commented 8 years ago

This is probably an issue with converting the HTML the editor field generates to markdown. Seems like the conversion lib we're using doesn't support line breaks in markdown (append 2 or more spaces to the end of a line to create a hard line break).

MathiasGmeiner commented 7 years ago

An ugly bugfix for this problem (in field-wysiwyg/field/wysiwyg.php):

    protected function convertToHtml($markdown)
    {
        $Parsedown = new Parsedown();
        return str_replace("\n", '<br>', $Parsedown->text($markdown));
    }