Preserve Line Breaks - Simple HTML DOM Parser

后端 未结 5 2098
忘掉有多难
忘掉有多难 2021-02-01 18:21

When using PHP Simple HTML DOM Parser, is it normal that line breaks
tags are stripped out?

5条回答
  •  青春惊慌失措
    2021-02-01 18:29

    Was struggling with this as well, since I needed the HTML to be easily editable after processing.

    Apparently there's a boolean in the SimpleHTMLDOM script $stripRN, that's set to true on default. It strips the \r, \n or \r\n tags in the HTML.

    Set the var to false (several occurences in the script..) and your problem is solved.

提交回复
热议问题