Coder Social home page Coder Social logo

Support H4-H6 as well about edit-text HOT 4 CLOSED

tcr avatar tcr commented on May 20, 2024
Support H4-H6 as well

from edit-text.

Comments (4)

briankabiro avatar briankabiro commented on May 20, 2024 1

Hey, @tcr. Just wanted to get some clarification on this. Is it duplicating the code in the Button Handler section just like it's been done for h1, h2, h3?

from edit-text.

tcr avatar tcr commented on May 20, 2024

@briankabiro Yeah! So to run down the list of what would need support added, it would be:

  1. Add a new entry in the button handler, as you mention, similar to h1, h2, h3
  2. Add support in the schema.rs file for identifying h4, h5, h6 as the RtfTrack::Blocks blocks type
  3. Modify the markdown serialize and deserialize methods for supporting h4, h5, h6.

Incidentally, it looks like steps 2 and 3 are already done, so only #1 is left to do.

A stress test of using this is to run the server and client locally (./x.rs server --client-proxy and in a separate tab ./x.rs client-proxy) and then navigate to http://localhost:8000/$/multi/, which will display three clients at once, and click the 🙈🙉🙊 button at the top, which will hit buttons at random. This will stress-test the new button entries and make sure there's no surprising behavior after adding h4, h5, h6 support. For example, if the schema did not recognize these values, but there were buttons for it, it would panic. I believe there's no risk of that happening here, but still worth checking.

Let me know if I can add any more detail to these steps. An issue I haven't opened yet (but intend to) would be to add blockquote support, for which steps 1, 2, and 3 would need to be followed, since there's no support yet. I can open that issue if it's interesting.

from edit-text.

briankabiro avatar briankabiro commented on May 20, 2024

Hey, thanks for the clarification. I've looked into it and added the entries in the Button Handler.
I also ran the stress test after making the changes and left it to run for a couple of minutes. No panics during that time. Have opened a PR just now.

Also, +1 on adding the blockquote issue, I could check it out later on. 😃 

I'll read up on the steps you outlined above so that I can get a feel of how to do that.

from edit-text.

tcr avatar tcr commented on May 20, 2024

All set :)

from edit-text.

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.