Coder Social home page Coder Social logo

Comments (5)

ahmadajmi avatar ahmadajmi commented on August 15, 2024

The following CSS might be a good fix:

pre { word-break: break-all; }

from type.

stigvoss avatar stigvoss commented on August 15, 2024

The break-all keyword does not seem to be recognized by my Firefox browser, although anywhere seem to exist and works for breaking the lines, well, anywhere.

It works as a fix, I assume the alternative would be to allow horizontal scrolling in code blocks. I'm not sure which is the better solution as both broken lines and scrolling makes it difficult to read code on a mobile device.

Would you know of a way to allow horizontal scrolling in a code block?

from type.

stigvoss avatar stigvoss commented on August 15, 2024

After having a look at the issue again, I have to conclude that I confused word-wrap and the word-break you refer to above. You are correct that the following will solve the issue.

pre {
  word-wrap: break-word;
  word-break: break-all;
}

Besides that, the issue only seemed to surface in Firefox, not Chrome.

from type.

ahmadajmi avatar ahmadajmi commented on August 15, 2024

Thank you! I merged the PR. I tested it in Firefox and seems to be working fine too.

Screenshot: Screen Shot 2020-01-17 at 5 04 26 PM

from type.

ahmadajmi avatar ahmadajmi commented on August 15, 2024

Would you know of a way to allow horizontal scrolling in a code block?

I created a new issue at the moment for this and I will look into it further.

from type.

Related Issues (13)

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.