Code Monkey home page Code Monkey logo

Comments (6)

pmario avatar pmario commented on August 27, 2024

Your example does not show the plain text that creates the output.

from tiddlywiki5.

pmario avatar pmario commented on August 27, 2024

The HTML CODE element does not respect any overflow settings. overflow requires a "block" element. CODE is an inline element. So the only way to "wrap lines" with extra long inline-code is to use white-space: pre-wrap; which is exactly, what the Theme-Tweak setting does.

If you use code-blocks instead of `inline code`

```
your-code-block-comes-here
```

It should work as expected.

from tiddlywiki5.

pmario avatar pmario commented on August 27, 2024

You could do this, if you want to force it into 1 line and a scroll-bar. The scrollbar is created by PRE, which is a block element.

<pre style="overflow:auto">`sssssssssssssssssssssssssssssssssss ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
`</pre>

from tiddlywiki5.

Leilei332 avatar Leilei332 commented on August 27, 2024

Actually, I did use code blocks in the screenshot.

Since you mentioned inline code, I tested them in tiddlywiki 5.3.4 prerelease with only highlight.js plugin installed.

图片

The plain text:

图片

The inline code is unwrapped and overflowed. I think it shouldn't be unwrapped since it isn't a code block.

For the two code blocks, only the second code block which is rendered by highlight.js showed a scroll bar. The first one is overflowed.

from tiddlywiki5.

pmario avatar pmario commented on August 27, 2024

You are right. It seems we do it wrong and highlight.js does it right. A bit more experimenting is needed. We need to make sure, that there are no unwanted side effects.

It seems hljs does set the class of the CODE element to display: block; overflow-x: auto, which seems to do the trick.
A bit of padding adjustment should be needed too.

Nice catch -- Thanks for reporting

from tiddlywiki5.

pmario avatar pmario commented on August 27, 2024

The padding needs to be adjusted if "Wrap long lines in code blocks" is set to "No" in "Theme tweaks"

grafik

from tiddlywiki5.

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.