我们在我们的站点中使用 jHtmlArea 作为 html 输入元素。我注意到在我们的实现中添加换行符会生成一个包含 br 标记的新 div 标记。将文本添加到该行会删除 br 标记,结果 html 呈现没有中断。
关于此处提供的示例: https ://pietschsoft.com/Demo/jHtmlArea/Default.htm
添加一行会创建一个段落标签,而不是一个 div+br。有没有人见过类似的东西需要添加两行才能换行?
关于调试此问题的后续步骤的一些想法或只是习惯了两行方法?
编辑:
相关的jsfiddle - https://jsfiddle.net/xrtaw4k8/1/
<script type="text/javascript" src="https://pietschsoft.com/Demo/jHtmlArea/scripts/jHtmlArea-0.8.alpha.min.js"></script>
<script type="text/javascript" src="https://pietschsoft.com/Demo/jHtmlArea/scripts/jHtmlArea.ColorPickerMenu-0.8.alpha.min.js"></script>
<!--http://rs.01298.com/rs/lib/js/jHtmlArea-0.8.min.js-->
<link rel="stylesheet" href="https://pietschsoft.com/Demo/jHtmlArea/content/jHtmlArea/jHtmlArea.ColorPickerMenu.css">
<link rel="stylesheet" href="https://pietschsoft.com/Demo/jHtmlArea/content/jHtmlArea/jHtmlArea.css">
<link rel="stylesheet" href="https://pietschsoft.com/Demo/jHtmlArea/content/bootstrap/bootstrap.min.css">
<div>
<textarea cols=90 rows=50></textarea>
</div>
脚本:
$('document').ready(function() {
$('textarea').htmlarea();
});