Giter Site home page Giter Site logo

Comments (2)

softxiang avatar softxiang commented on August 21, 2024

这个问题你解决了吗?还发现重新编辑之前的markdown的时候样式变成html样式了
image

from jpress.

dengdaiyemanren avatar dengdaiyemanren commented on August 21, 2024

经过调试发现原因是:
数据库中保持的是markdown 编译之后的文本,重新从数据库中获取后得到的调整后的html片段,所以加了

标签。
解决方法之一是:
在数据库中加一个字段保持编译之前的文本,在编辑态展示这个文本,就没有问题了。

步骤:
1、jpress_context 加一个字段,如 marked
2、修改代码BaseContent.java

	public java.lang.String getMarked() {
		return get("marked");
	}
	
	public void setMarked(java.lang.String marked) {
		set("marked", marked);
	}

3、
1)修改页面:_edit_include.html

2)修改页面:edit.html

function initMarkdownEditor(){
	if("" != $('#content_marked').attr('value'))
	{
	 	$('#textarea').text($('#content_marked').attr('value'));
	 }

	 simplemde = new SimpleMDE({ element: $("#textarea")[0] });	 
}
function save(){
	
	 $('#content_slug').attr('value',$("#slug_text").text());
	
	if("tinymce" == _editor){
		tinymce.activeEditor.uploadImages(function(success) {
			tinymce.triggerSave();
			 $('#content_marked').attr('value',"");
	 		doSubmit();
		});
	}else{
		$("#textarea").text(simplemde.markdown(simplemde.value()));
		$('#content_marked').attr('value',simplemde.value());
		debugger;
		doSubmit();
	}
	return false;
 }

from jpress.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.