php-markdown icon indicating copy to clipboard operation
php-markdown copied to clipboard

How to convert newline to br tag

Open euclid1990 opened this issue 9 years ago • 3 comments

  1. Same the GithubMarkdown, when we typing enter, it's preview start new line. But with michelf/php-markdown, we need type twice enter to start new line. Please help me ! Note: I have setup no_markup = true; (So I cant using
    tag in Markdown)
  2. Please solve this bug: When user input: [I'm an inline-style link](javascript:alert('xss')) It allow browser click and alert !

euclid1990 avatar Feb 16 '16 09:02 euclid1990

The Markdown syntax for a line break is to add two spaces at the end of a line. Github is twisting the rules when rendering comments, but not when rendering .md files. I'd be willing to accept a patch that implements automatic line breaks as an optional feature though.

PHP Markdown is not a filter for malicious content. Please run an additional filter on the HTML output if you need to protect against scripting attacks. https://michelf.ca/blog/2010/markdown-and-xss/

michelf avatar Feb 16 '16 14:02 michelf

Github style line breaks would be a nice option, since that's the only reason why I need to switch to a different parser. Maybe I have time to program a patch for it.

fliiiix avatar Apr 16 '16 10:04 fliiiix

Even two additional lines with two spaces at each line didn't place any br tags. How to force it?

Lisio avatar Apr 21 '16 07:04 Lisio