Giter Site home page Giter Site logo

Comments (5)

margox avatar margox commented on May 18, 2024

第一点是因为我这边没有把空格抓换成  ,后面会改进,第二点,麻烦能贴下你的使用代码么?

from braft-editor.

qjp88995 avatar qjp88995 commented on May 18, 2024
render() {
        const editorProps = {
            height: 600,
            contentFormat: 'html',
            initialContent: this.props.content,
            // onChange: this.handleChange,
            onHTMLChange: this.props.onChange,
            controls: [
                'undo', 'redo', 'split', 'font-size', 'font-family', 'text-color',
                'bold', 'italic', 'underline', 'strike-through', 'superscript',
                'subscript', 'text-align', 'split', 'headings', 'list_ul', 'list_ol',
                'blockquote', 'code', 'split', 'link', 'split', 'media'
            ],
            colors:[
                '#000000', '#333333', '#666666', '#999999', '#cccccc', '#ffffff',
                '#61a951', '#16a085', '#07a9fe', '#003ba5', '#8e44ad', '#f32784',
                '#c0392b', '#d35400', '#f39c12', '#fdda00', '#7f8c8d', '#2c3e50'
            ],
            fontSizes:[
                12, 14, 16, 18, 20, 24,
                28, 30, 32, 36, 40, 48,
                56, 64, 72, 96, 120, 144
            ],
            fontFamilies:[
                {
                    name: 'Araial',
                    family: 'Arial, Helvetica, sans-serif'
                }, {
                    name: 'Georgia',
                    family: 'Georgia, serif'
                }, {
                    name: 'Impact',
                    family: 'Impact, serif'
                }, {
                    name: 'Monospace',
                    family: '"Courier New", Courier, monospace'
                }, {
                    name: 'Tahoma',
                    family: "tahoma, arial, 'Hiragino Sans GB', 宋体, sans-serif"
                }
            ],
            media:{
                image: true, // 开启图片插入功能
                video: false, // 开启视频插入功能
                audio: false, // 开启音频插入功能
                validateFn: null, // 指定本地校验函数,说明见下文
                uploadFn: this.uploadFn // 指定上传函数,说明见下文
            }
        }
        if(this.props.ready){
            return (
                <div style={{background:'#fff'}}>
                    <BraftEditor {...editorProps}/>
                </div>
            )
        }else{
            return <div></div>
        }
}

from braft-editor.

qjp88995 avatar qjp88995 commented on May 18, 2024

应该是转换的时候没有转换一个
,存在数据库里的是

<p></p>
<p></p>
<p></p>
<p></p>

一个空的p标签,但是我在网页上把p标签的默认margin设为0了
所以应该是这样:

<p></p>
<p>
    <br/>
</p>
<p></p>
<p></p>

from braft-editor.

margox avatar margox commented on May 18, 2024

抽空做了软换行的功能,现在按Ctrl或者Shift + Enter,就能生成br而非p了,至于空格的问题,估计要再等等了😂😭🙄

from braft-editor.

margox avatar margox commented on May 18, 2024

感觉我这边把空格转成&nbsp;来实现缩进,会伤及无辜,还是建议用css来控制段落的缩进吧

from braft-editor.

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.