Coder Social home page Coder Social logo

Comments (6)

marijnh avatar marijnh commented on August 23, 2024 1

The schema puts a block node there, which makes sense (you can have nested lists and such in tight list items), and the editor view expects nodes in the document to have a DOM node equivalent, so I don't think not rendering the paragraph is a very practical approach.

from prosemirror-markdown.

flaki avatar flaki commented on August 23, 2024 1

I see! Thanks for elaborating! Maybe then including the above CSS snippet by default and documenting this behavior would be a better recourse?

from prosemirror-markdown.

marijnh avatar marijnh commented on August 23, 2024

Have you tried adding styles to ul[data-tight=true] li that remove the margins?

from prosemirror-markdown.

flaki avatar flaki commented on August 23, 2024

Appreciate the swift response, yes making the <p> inside display: contents is how I'm currently working around this, but I suspected that perhaps it was worthy to have a more clean solution of not rendering the paragraph elements in the first place?

from prosemirror-markdown.

stephane-klein avatar stephane-klein commented on August 23, 2024

Same subject here: https://discuss.prosemirror.net/t/lists-paragraph-inside-li-instead-of-new-list-item/455/8

from prosemirror-markdown.

stephane-klein avatar stephane-klein commented on August 23, 2024

Have you tried adding styles to ul[data-tight=true] li that remove the margins?

I've corrected the display with these lines of css:

.ProseMirror ul li p:first-child {
    margin-top: 0;
}
.ProseMirror ul li p:last-child {
    margin-bottom: 0;
}

See in my POC project: https://github.com/stephane-klein/poc-svelte-prosemirror-markdown/blob/6a27f64eb7bd23663021a945d180b29c88d073d6/src/routes/editor.css#L336

from prosemirror-markdown.

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.