Giter Site home page Giter Site logo

fix linebreaks about graphene HOT 2 CLOSED

aldy505 avatar aldy505 commented on May 27, 2024
fix linebreaks

from graphene.

Comments (2)

kmarrip avatar kmarrip commented on May 27, 2024

can you add more context for this @aldy505

from graphene.

elianiva avatar elianiva commented on May 27, 2024

So, we want an option to soft-wrap the text like this:

image

Notice how the wrapped text has no line number. In order to do that, we need to wrap them from the renderer because if you split the line and then highlight it using Shiki, 1) It will mess up the highlighting, 2) It will have a line number.

This would be super easy on plain HTML rendered on a browser, but we use SVG. Someone needs to figure out how to render multiline on SVG after the text has been highlighted. There are some things to consider:

  1. Shiki returns token, one will need to figure out how to split them after a certain amount of characters. PORT in that screenshot will count as 1 token but you need to split it into 2 without loosing its highlight.
  2. If you render multiple lines, you must add an offset for the next line since the current line, which should take, let's say 20px, now is taking 40px because it got split into 2. The next line which should have 40px offset now needs to have 60px offset.

from graphene.

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.