不确定这是否是实际问题,但我正在使用Epic Editor在我的GAE应用程序中输入并保存降价(webpy和mako作为模板引擎)。EpicEditor文本显示为 而不是空格
当我提交表单时,EpicEditor的内容填充了一个隐藏的输入元素,但所有的空格都被
取代。这是一个预期的功能吗?如果我在EpicEditor网站上查看相同的代码,它显然会返回空格而不是
,那么我的有什么不同?
<form>
<!-- form elements -->
<input id="content" name="content" type="hidden" value></input>
<div id="epiceditor"></div>
<button type="submit" name="submit" id="submit">submit</button>
</form>
<script type="text/javascript">
$('button#submit').click(function(){
var content = editor.getElement('editor').body.innerHTML; //all the spaces are returned as and breaks are <br>
$('input#content').html(content);
});
</script>
注:我想我的内容降价保存在TextProperty场我的数据存储和生成的HTML标记时,我检索使用marked.js
另外,请注意,随着EpicEditor的发展,编辑器HTML中会有更多的标记可能会添加功能,右键单击菜单等,所以不要依赖HTML内部。 –